2

Since Android ICS, you can set your mobile data usage limits. You are able to set a soft and a hard data usage limit. This is located under settings -> data usage This screen also shows you the amount of data used for this month.

I would like to show this data in a widget but I am unable to find how to get the:

  • data used this month
  • mobile data soft limit
  • mobile data hard limit

I found this but this does not look like the right code.

Vinay
  • 6,891
  • 4
  • 32
  • 50
Bas van Dijk
  • 9,933
  • 10
  • 55
  • 91
  • Did you ever find a solution to this question? I am after the same thing. – CeejeeB May 15 '13 at 12:27
  • I have same need: http://stackoverflow.com/questions/24366016/how-to-get-programmatically-the-data-usage-limit-set-by-user-on-android-os-confi – Idemax Jun 24 '14 at 15:19

1 Answers1

0

http://developer.android.com/reference/android/net/TrafficStats.html

That should solve your problems

gaara87
  • 2,087
  • 3
  • 21
  • 43
  • Thanks, but this API does not provide data range and also does not provide the hard and soft limits set by the user. – Bas van Dijk Aug 02 '12 at 11:39
  • I have same need: http://stackoverflow.com/questions/24366016/how-to-get-programmatically-the-data-usage-limit-set-by-user-on-android-os-confi – Idemax Jun 24 '14 at 15:18