Issue
I am getting gps location information and displaying it on google maps using Javascript API through WebView. I notice that the location information is not very accurate though I am using EnableHighAccuracy as true. Also I notice that the google maps app in android is able to pick up the location many times faster than my app and also able to show the location more accurately.
How is this possible? Both apps are using the available A-GPS information on android and displaying on same map.
Any thoughts on this. Also any suggestions how I can improve the accuracy.
Update: Using location information through Javascript and WebView on Android shows my current location as atleast 2-5 miles away from where I current am. However google maps app in android is able to identify the building in which I am currently sitting. Also google maps app picks up this location with 2-5 secs, where as the webview one takes more than a minute and still gives a inaccurate location.
Solution
I think you might find that the WebView
"best" location algorithm is not as sophisticated as the Google Maps algorithm. The problem you see may be related to the WebView
picking the "best" location provider and getting stuck with that choice, even if another provider later becomes "best."
If it meets your requirements, you will probably have better results writing the LocationManager
code yourself and sending the results to your WebView. In this way, you could monitor multiple providers and can switch between them based on which is providing the best recency/accuracy trade-off for your application.
Here's a good guide on getting started with a sophisticated location algorithm: http://developer.android.com/guide/topics/location/strategies.html
Answered By - James
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.