I know there is a way to read bandswitch.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no documented way in the iPhone SDK to do this. I am pretty sure that they use sysctl(), which is a standard BSD call, so it must be present on iPhone OSX, too.
See this answer:
How to get network adapter stats in linux/Mac OSX?
A good question is how they got through the Appstore procedure. I think sysctl() is about “halfway” from documented to undocumented API: it is not mentioned in the SDK documentation, but it is present on all BSD systems. So it is possible that Apple does not (or did not) filter for standard BSD calls, and that’s why they let sysctl() through.
UPDATE: I successfully ran this netstat code on iPhone Simulator (i have no iPhone device with me at the moment). All I had to do is to comment out
#include <net/route.h>because it is not present in iPhone SDK, and copy the following definition from this header:So it was simpler than I thought. Because there were basically no function calls in this code that is not in the SDK headers, it is possible that Apple will approve your application if you use this code (they cannot filter for simple constants…).