Using Google Maps locations without activity

I have a service that receives seats through registration at LocationManager.requestLocationUpdates . But some phones had some problems.

When the battery runs down, the network location provider stops sending location corrections (this issue is addressed in this SO issue ). This is not the only problem with my application, but other applications just stop getting places. Even when the phone is recharging, the problem persists until it is completely rebooted.

However, I found out (and someone also mentioned this in the SO question above) that Google Maps is still continuing to receive location updates - when I open the Google Maps app, it shows the correct location and updates.

So, I was thinking of a workaround for using locations from the Google Maps API. I have absolutely no experience with the Maps API, but it seems like he needs a GUI application (Activity) to be used. Or I'm wrong? Is it possible to use the Google Maps API to get seats even within the Service?

+2
android google-maps geolocation
Jul 18 '13 at 22:16
source share
1 answer

Given some extensive tests from a trusted source, I think you might need to use the FusedLocationProvider that comes with Google Play Services. Headache seems to have gone out of the selection of suitable power criteria, etc.

Keep in mind that this requires Google Play to be installed on your device, so Kindles and the like will not be displayed. It also requires a minimum of Android 2.2.

Find out more about the location services provided by Google Play services here .

+3
Jul 30 '13 at 21:42
source share



All Articles