Darko Petkovski
Darko Petkovski

Reputation: 3912

how to get mobile data usage from the android device?

Does anyone know, how can I get mobile data usage from the android device? I've tried this code, but It only returns data for the current month - but I need this statistics for longer time(not only the current month)

long mobile = TrafficStats.getMobileRxBytes() + TrafficStats.getMobileTxBytes();
Log.d(TAG, "mobile internet: " + mobile / 1024 + " Kb");

Is there a way to get this using getContentResolver().query like we do for getting calls or sms history?

Just to clarify I am looking for the data from this screen: enter image description here

Upvotes: 0

Views: 693

Answers (0)

Related Questions