简体   繁体   中英

How does google maps get location on android device?

I am an android developer and have been using it for a while to develop context-aware apps. Location is one of the most important thing for context aware and accuracy of that location is very important.

I know how to get location from GPS using LocationManager... I know how to develop apps using Google maps on android... and also how to display user on the map.. etc. But my friends have found out that when they went to a foreign country for a conference, their location from LocationManager is very inaccurate compare to google maps.

They used my app (not released yet.. ) which I get my location from LocationManager and I registered for GPS and Network provider. If I plot the location that the phone gives me on a map... it's very inaccurate... some times it thinks the user is in Barcelona even though they are at a conference in USA.

Also since the conference was indoor, the GPS wouldn't have helped a lot because it would've had hard time finding a fix.

Does google maps on android get their location similar to how google tells the android developers to get the location... from LocationManager and register for onLocationChanged location listener? If it does... how come theirs is more accurate... how do they filter any outliers? or are they using any internal services to get even more accurate location which maybe google assume that if the developer get that accurate location they could misuse it?

Any ideas or comments??

This code is written by Reto Meier, Tech Lead for Android Developer Relations, who wrote the book on Android App development. Also, that was published in Google IO conference in 2011 as I remember. This is the closest to what is used in Google Places. And it works smart anyway ;) https://code.google.com/p/android-protips-location/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM