Lin Shengjie
Jan 09, 2019
1:57 pm

How can I keep my app alive in backouground all the time

any api of knox can help me?

Similar topics

No similar topics found.
Konrad Sobczak
Jan 11, 2019
12:27 pm

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.

Lin ShengjieJan 11, 2019 at 5:15 pm