I have an Android application which displaying data usage per app by NetworkStatusManager, but I can't get data usage for Tethering and Mobile Hotspot. How should I do this?
You need to query by UID and pass in the tethering UID: android.app.usage.NetworkStats.Bucket.UID_TETHERING
like so:
networkStatsManager.queryDetailsForUid(ConnectivityManager.TYPE_MOBILE,
subscriberId, startDate, endDate,
android.app.usage.NetworkStats.Bucket.UID_TETHERING);