tags:

views:

36

answers:

2

Hi,

Are there any best practices for an app to get the same geo location as the Google Maps app?

For example, my app lists nearby Sprockets based on a user's geolocation. Often the geolocation I come up with is different than what the Google Maps app comes up with (which is often more accurate).

We can kind of do this if we have a MapActivity and use MyOverlay - this should give us the same location google maps would show - but we always need to display a map to use this. I'm almost considering just hosting a hidden map on my activity in order to use MyOverlay and grab better location updates! Any more sane way of doing this?

Thanks

A: 

Android has a full location API. This is what the map system uses.

Yann Ramin
Yes the location API just gives you changes in location from the providers you're subscribed to - but it's up to the developer to decide how to use these updates - which often times comes out differently than what the maps app shows. I'd just like to know how the maps app implements this really.
A: 

A good direction to look is the open-source Foursquare app's location code if you're looking to manage location reports from multiple providers (GPS, network, etc.) and balance freshness and so forth. IMO their solution is a bit overarchitected for most needs, but the basic ideas are pretty easy to grok from it.

Yoni Samlan