I am using background service to get user location and upload to server.
I have used one LocationTrack class which is extending Service class and AlramReciver which is extending BroadcastReciver.
I have added all permission in manifest and register AlarmReciver and LocationTracker class in manifest file.
But when app goes into DOZE mode then service is not working.
I have tried following links but its not working anyways.
- How to create background services for android Oreo without notifications like social networking applications Facebook, Messenger, Zalo
https://developer.android.com/training/monitoring-device-state/doze-standby
I have tried Jobdispatcher also but nothing works out.
Possibly it seems duplicate question but i don't understands whats wrong with my Code. Please help to get rid of this. Thanks in advance.
You can use firebase job dispatcher for background service which works on all versions of android and is handled by firebase.
Check this answer with firebase job dispatcher