I think this question is asked many time in stackoverflow
but still so many people struggling to resolved it.
In my android app I have to wake up device
Hi I have got same issue while testing in Xiomi phone.leeco I haven't much idea. Xiomi phone have their own OS that is MIUI.When we cleared RAM it clear all the apps execpt some of apps register in OS. Like Whatsapp and facebook some other famous apps.
I have tried Service, Alarm Manager and Scheduler but not get any success.
They provide some manually specfic way to run services.I have checked Leeco it used Android OS.
Solution for MIUI 7.0 => Security => Autostart => select Apps that you want to run in background => Reboot After reboot your device should able to run your application services in background like other android devices do.
MIUI 4.0 settings
MIUI AutoStart Detailed Description
According to me you can try with Services then check if it work or not.
Thanks hopefully you'll get bit help from this.