How can I keep my app alive in backouground all the time
any api of knox can help me?
Hello Lin Shengjie,
You can use public int addPackageToBatteryOptimizationWhiteList (AppIdentity appIdentity) method of ApplicationPolicy class to exlude your app from Battery Saving features and Doze Mode and public boolean addPackagesToForceStopBlackList (List<String> packageList) to exclude app from being force stopped by system.
Best regards, Konrad.
Unfortunately, they dont work quite well. My app is still killed by system if I put it on backound and continuously run other apps.
It seems not Doze Mode but lack of memory leads to this case.