0

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

Md. Sabbir Ahmed
  • 850
  • 8
  • 22
Darko Petkovski
  • 3,892
  • 13
  • 53
  • 117
  • http://www.techrepublic.com/blog/software-engineer/create-a-network-monitor-using-androids-trafficstats-class/ – Sree Oct 06 '15 at 09:21
  • @Darko did you saw this link:http://stackoverflow.com/questions/11939939/android-how-can-i-find-the-data-usage-on-a-per-application-basis – AnswerDroid Oct 06 '15 at 09:21

0 Answers0