Skip to content Skip to sidebar Skip to footer

Trafficstats.getuidrxbytes() Giving 0 For All Processes

I make this program and my TrafficStats.getUidRxBytes() methods are giving me 0 all the time. I check with my apps and the have data usage records, but my code is not showing the d

Solution 1:

This is a known bug, which some people claim that got fixed on Android 4.4 .

Here's a way to handle it, and here's where this issue got reported.

Basically, what you need to do is to parse the files located on "/proc/uid_stat/" . each folder there the name of the UID of the applicationInfo (of each app). First row is the number of bytes received, and second row is the number of bytes sent.


Post a Comment for "Trafficstats.getuidrxbytes() Giving 0 For All Processes"