I'm interested in measuring the network traffic for my application. Ideally I would need to separate wireless from 3G network traffic. I can't seem to find any API that gets this information; however I see that there is at least one app in the AppStore that does something close (they actually sum up the traffic for the entire phone).
Any ideas?
The best way to check network traffic is with a tool like SolarWinds® Bandwidth Analyzer Pack (BAP). BAP is built to automatically check and compile network traffic insights from devices across your network in a centralized dashboard and alert you to any concerning behavior in your network.
I've found one approximate solution: getifaddrs
can be used to get statistics on network usage.
One advantage is that it can get separate statistics for Wi-Fi and WWAN interfaces.
A disadvantage is that on multi-tasking devices those interfaces may be used by multiple applications and the statistics are cumulated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With