For statistic network traffic per APP, what I’m using now is Android TrafficStats
That I can get result like following :
- Youtube 50.30 MBytes
- Facebook 21.39 MBytes
- Google Play 103.38 MBytes
- (and more…)
As I know, the “Android Trafficstats” just a native pointer to a c file. (maybe an .so ?)
But it mixed Wifi & 3g traffic, is there any way to only get non-WiFi traffic statistic ?
Evening all, I got some way to do that…
First I have to create a class which extends BroadcasrReceiver, like this:
Manifest definition:
Codes:
And a phone stats listener below…
Finally, here’s my logic
As I know, network traffic will go through WiFi only, if both 3G & WiFi are available.