Getting network interface info (pdp_ip0 -- cellular data usage).
. . The iPhone gives the user some info about how much data it transfered overtime in its menu (Settings -> General -> Usage -> Cellular Network Data). Altough the official APIs doesn't mention anything related to this, I know you can get some info from the network interface (pdp_ip0 for cellular info).
. . In the ideal cenario I would get this info "legally" and would be able to get my app in the App Store, but I don't really need that because this app will be used for a limited number of users (no more than 10 at time) and I can do some "ad hoc" distribution. Anyway, if it is needed to use some undocumented API call or undocumented framework, ok (I can't pay the same, but still...)--but the app absolutely must run on stock iPhone (nothing jailbreak-only).
. . All I need is to get this info into a variable.
. . Does anyone knows how to get this info from the network interface? A buddy told me it is possible (and I know it is because there is an app in the App Store that does just that), but I couldn't find how, yet.
. . Some progress, but not much: the app is really getting info from the network interfaces. I managed to install the "network-cmds" on an iPhone and have access to ifconfig and netstat commands, but none of them returned anything meaningful (the "netstat -s" is more or less usefull, but can't show interface-specific info). "ifconfig" doesn't show anything good (no RX or TX bytes).
. . ifconfig:
cuckoo:~ root# ifconfig pdp_ip0
pdp_ip0: flags=8011<UP,POINTOPOINT,MULTICAST> mtu 1024
. . Anyway, these commands are not installed by default in the iPhone, so how can I call them from an application? Is there any way to include a precompiled binary into the app? Or another way to get network info?
let me know if you have since come up with a method - i'd like to get your opinion.
there is an app called "DataMan" that is doing it - so i know it's possible.
i have no idea how they're doing it.
Quote:
Originally Posted by dnunes
. . Some progress, but not much: the app is really getting info from the network interfaces. I managed to install the "network-cmds" on an iPhone and have access to ifconfig and netstat commands, but none of them returned anything meaningful (the "netstat -s" is more or less usefull, but can't show interface-specific info). "ifconfig" doesn't show anything good (no RX or TX bytes).
. . ifconfig:
cuckoo:~ root# ifconfig pdp_ip0
pdp_ip0: flags=8011<UP,POINTOPOINT,MULTICAST> mtu 1024
. . Anyway, these commands are not installed by default in the iPhone, so how can I call them from an application? Is there any way to include a precompiled binary into the app? Or another way to get network info?