0

Does anyone know if google geolocation feature/api makes an actual request to server even when it detectes you haven't moved ? For instance, if wifi hotspots and their strengths didn't change since last location they can assume you haven't moved so there's no need to go to google 's server ! Do they have this kind of logic performance in the client ? I'm more interested on Android google maps api.

Thanks !

1 Answer 1

1

Better than that : the network location API caches data on your phone so even if you move it may not need to make a request.

Example of the logs seen on my Nexus One:

D/androidNlpServiceThread(  194): adding listener com.google.android.location.internal.client.NetworkLocationClient$1@405575e8 with period 45
D/androidNetworkLocationListeners(  194): Still have listener com.google.android.location.internal.client.NetworkLocationClient$1@405575e8
D/androidNlpServiceThread(  194): adding listener com.google.android.location.internal.client.NetworkLocationClient$1@405575e8 with period 45
D/androidNetworkLocationListeners(  194): Still have listener com.google.android.location.internal.client.NetworkLocationClient$1@405575e8
D/WifiLocator(  194): Good cache hits. Computing WiFi location locally hasLocation=4 noLocation=0 cacheMiss=0
D/WifiLocator(  194): Computing location using MaxLre.
D/WifiLocator(  194): Finished computing WiFi location: WifiLocationResult [position=Position [redacted], confidence=78, outliers=[]]
D/CellLocator(  194): Found cell location: Position [redacted]
D/androidNlpServiceThread(  194): reporting Location[mProvider=network,mTime=1340791812841,mLatitude=****,mLongitude=****,mHasAltitude=false,mAltitude=0.0,mHasSpeed=false,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=true,mAccuracy=42.0,mExtras=Bundle[{networkLocationSource=cached, networkLocationType=wifi}]]
D/ClientReporter(  194): reported location
4
  • From what I've seen, the client sends to google geolocation api your own mac address and nearby wifi hotspots 's mac addresses and SIDs, and their signal strength; with this info then Google's response contains your estimate coordinates and its accuracy. So what data does exactly the android phone cache? According to you what's the criteria that android uses to decide whether to use the cache data or query google server again?
    – cesarmax
    Jun 26, 2012 at 16:14
  • it caches the bssids of the hotspots around you so it can query them locally without going to the server. If there are too many "misses", it will go to the server. You can see it in the logs on HTC phones such as the Nexus one. I've added the logs to the original answer Jun 27, 2012 at 9:25
  • Please assign answer if this is satisfying. If not, let me know why. Jul 3, 2012 at 9:52
  • Sorry for the delayed reply. Thanks for the answer. That's what i was looking for !
    – cesarmax
    Jul 3, 2012 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.