Is there any substitute for TrafficStats for Android 2.1 API 7?

530 Views Asked by At

Is there any substitute for Android.net TrafficStats class for 2.1 API7? Since TrafficStats supports only 2.2 & above versions.

1

There are 1 best solutions below

0
On

TrafficStats supports only 2.2 & above versions. But we know how it works.
The TrafficStats class reads the system file in linux kernel to get the date. So maybe we can try to handle this by ourselves. When I run "cat /proc/net/dev" in adb shell I can get the traffic data. So I'm trying to read this file in my app. Maybe this blog can help you.
And here is a similar question.