When i try to retrieve traffic data using TrafficStats class,
TrafficStats.getTotalRxBytes()
and TrafficStats.getTotalTxBytes()
functions always return -1 even if i use the browser to load some web pages.
I knew from some forums that -1 mean that the device don't support the action. I used WVGA, NEXUS ONE and NEXUS S and the problem persists.
Thank you.
If you are using emulator it might not work. Try on a real device.