0

I am using the Location Listener as Service in my app. "onLocationChanged" method is perfectly working when the app is active, meaning the Latitude and Longitude values are received in the broadcast receiver of the main activity. But when the phone is locked by pressing the power button, Latitude and Longitude values are not received after 60 sec. I confirmed it by debugging log message. After 60 seconds when the phone is locked the debug message in the log is stopped. Does anyone face the same issue? Please share any solution for this issue.

1 Answers1

0

I have resolved the issue by using "Google Play Services" https://github.com/nickfox/GpsTracker/blob/master/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java

Now I am getting the location information without any time limitation even if the phone is locked. This was suggested in solution of Background service with location listener in android

Thanks to Nirmal - https://stackoverflow.com/users/137954/nirmal

However, it would be great if any expert shares why Location listener simply stopped after 60Seconds when phone is locked.