How to keep an app since SDK 16 running foreground every time? I’m building an app to monitoring the android device.
I’ve looked in 3 obstacles:
1 - The difference between android under and post 7.0.0 on foreground services
2 - Chinese ROMs, with an agressive kill of apps when user do a simple clean on last apps
3 - which android tool can I use for resolve it.
I’ve seen until now: AlarmManager, permanent notifications, accessibility service… Broadcast receiver to up application when system restart and battery optimization, but all my tries didn’t seem to help me in solving.
For example, the follow tutorial doesn’t work after I clean the lastest apps used in a Chinese ROM (Xiaomi) https://robertohuertas.com/2019/06/29/android_foreground_services/