Conflicting GPS location information in Android apps

I get gps location information and display it on google maps using the Javascript API via WebView. I noticed that the location information is not very accurate, although I use EnableHighAccuracy as true. I also notice that the google maps application in android can pick up a location many times faster than my application, and it can also show the location more accurately.

How is this possible? Both applications use the available A-GPS information on Android and are displayed on the same map.

Any thoughts on this. Also any suggestions on how I can improve accuracy.

Update. Using location information through Javascript and WebView on Android shows my current location at least 2-5 miles from where I am now. However, the google maps app in android can identify the building I'm sitting in now. Also, the Google Maps application displays this location after 2-5 seconds, where, since web browsing takes more than a minute, it still gives an inaccurate location.

+4
source share
1 answer

I think you may find that the <20> algorithm is best different from the Google Maps algorithm. The problem that you see may be that WebView selects the "best" location provider and is stuck with that choice, even if another provider later becomes the "best".

If this meets your requirements, you are likely to have better results that write the LocationManager code yourself and send the results to your WebView. Thus, you can control and switch between several providers based on what provides the best compromise between reputation and accuracy for your application.

Here is a good guide to getting started with a complex location algorithm: http://developer.android.com/guide/topics/location/strategies.html

0
source

All Articles