Our company giving out Android devices to drivers. Our application should never use more then 1Gb by nature of communications we do.
However, some drivers managed to use about 10Gb of data 🙂
So, I wonder:
-
Is there any way to track data usage of our app vs other apps so we can notify users and office workers?
-
Is there any way to DISABLE data access from any app other then ours?
As H9kDroid indicates, use
TrafficStats. Here is a sample application that takes an initial snapshot of the consumed bandwidth, then takes another one when you tap a button, displaying the overall difference on-screen and the per-UID difference in LogCat. Note that not all devices support the per-UID stuff (e.g., not the Ice Cream Sandwich emulator).No, sorry. Eventually, the combination of device admin rules and the new traffic management stuff in Ice Cream Sandwich’s Settings app might allow for this, but not presently. Or, you could create custom firmware.