You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/03/13 14:44:35 UTC

[GitHub] [cordova-plugin-geolocation] breautek edited a comment on issue #119: Getting location with high accuracy taking time more than 4 mins

breautek edited a comment on issue #119: Getting location with high accuracy taking time more than 4 mins 
URL: https://github.com/apache/cordova-plugin-geolocation/issues/119#issuecomment-463897045
 
 
   GPS features is something I heavily use in my apps and in my experience there are two things that can effect slow/non-existent GPS updates. 
   
   **1. User Settings**
   On most android versions, the user may have location mode set "battery saving" -- which makes it so the phone requires an internet connection because it only uses wifi & mobile networks to determine location. Or "Device Only", which means the phone must connect to satellites to obtain a location. From a cold fix, it can take 10-15 minutes even in good conditions on a decent device before you start seeing stable GPS updates. The best location setting the phone can be in is "High Accuracy" mode (not to be confused with the api's `highAccuracy` option), which allows the phone to use any number of strategies to obtain a GPS update as quickly as possible. Note that this is a user setting that is outside the control of the app, however I'm sure there are plugins that allows you to open up the appropriate settings screen for the user. I've seen other apps do it.
   
   **2. Poor Environment**
   Even with the phone has high accuracy enabled in their location settings. Being in a poor environment can hinder the ability to receive GPS events, or will cause received updates to have inaccurate results. The perfect environment to have stable GPS outsides is outside away from buildings, in clear skies weather. My work office is in a basement of a large building. If I require good accurate GPS events in my testing, I literally cannot do the test at my desk. No joke, if I have to I'd have to take my test device outside of the building and walk around in the parking lot. Alternatively I use a simulator where I have the ability to manually simulate GPS events as if they were coming from the GPS hardware. I'd also like to note that this issue is not exclusive to Cordova. Any app, whether it be Google Maps, or something else that shows your location all exhibit location troubles when I'm in my workplace building.
   
   In my apps, I use another third-party plugin called the Diagnostic plugin in conjunction with the geolocation plugin. It provides several APIs to figure out the current state of required features. Such as if the user has granted permissions, or if the GPS feature is turned off completely etc. I use this to provide helpful feedback to the user if they need to change something. https://github.com/dpa99c/cordova-diagnostic-plugin
   
   I hope this information helps.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org