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
In my android app I have to wake up device for every 15 min to getting current location and send it to server.
I have tested it on Xiaomi Mi 5s (Android 6.0.1). When I close the application, the application goes to sleep :( AlarmManager with setExactAndAllowWhileIdle() not working ¯\_(ツ)_/¯
Yes, it's working fine in almost all standard/popular devices like Samsung, LG (Nexus 5X), Sony, Motorola, Pixel...
MY SOLUTION:
The manifest entry for each type of component element — , , , and — supports an android:process attribute that can specify a process in which that component should run.
You need add this string android:process=":service" in your AndroidManifest.xml
Like this:
...
...
I have tested this solution on Xiaomi Mi 5s. It's work !!!
IMHO it seems that the Xiaomi firmware kills the main process whenever the user exits the application...