Shashipriya K
Nov 12, 2018
5:58 am

Issues faced with Data Usage APIs

We want to implemnet a feature to show the apps data usage for which we have used following code:

EnterpriseDeviceManager edm = (EnterpriseDeviceManager) NixApplication.getAppContext().getSystemService
        (EnterpriseDeviceManager.ENTERPRISE_POLICY_SERVICE);
ApplicationPolicy appPolicy = edm.getApplicationPolicy();
list = appPolicy.getApplicationNetworkStats();
for (NetworkStats netUsage : list) {
    //Here we get the data usage of apps :
    /*uid : netUsage.uid ,
             bytes received in wi-fi : netUsage.wifiRxBytes ,
             bytes sent in wi-fi : netUsage.wifiTxBytes ,
             bytes sent in mobile : netUsage.mobileTxBytes ,
            bytes recieved in mobile : netUsage.mobileRxBytes  */
}

We have few queries :

1)In this list we are not getting the UID for HotSpot & Tethering, How can we get the HotSpot & Tethering Data Usage?

2)When the Device is connected to Mobile Data and also enabled hotspot, now I use a app which will just do local broadcasting like DroidCam app. Then the droidcam app data usage in System Settings doesnt increase for using the local data but with knox APIs we see the Mobile data usage for droidcam keeps increasing ? Can we get a solution for this ?

3)When the device is connected to Wifi and Mobile Data by using android system apis we make sure that my app always use mobile data , but with Knox apis we can see that my app data usage is increasing in wifi not in mobile data . Can we get a solution for this ?

Similar topics

No similar topics found.