How to get Tethering and Mobile Hotspot data usage in Android using NetworkStatusManager or TrafficStat
问题 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? 回答1: 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); 来源: https://stackoverflow.com/questions