DEV Community

AmoghKrJain
AmoghKrJain

Posted on

Trying to run getLocation app in background but it's getting stops while screen locks

Hello Dear Comrades,
I am developing an android app to get location of the phone periodically. I am using a handler class with priority BACKGROUND, but it is not running when I locks the phone.
Please suggest a way to keep it running even when the phone is locked so that it can register location without needing attention everytime.
Many thanks :)

Top comments (1)

Collapse
 
mkdzt profile image
mkdzt

QQ,i saw the same, and found in codelab [codelabs.developers.google.com/cod...]