Coder Social home page Coder Social logo

Comments (10)

breautek avatar breautek commented on May 28, 2024 6

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.

from cordova-plugin-geolocation.

GPlay97 avatar GPlay97 commented on May 28, 2024

I have the same issue. Seems to happen only sometimes. Sometimes it resolves in a few milliseconds / a second, sometimes it takes a minute or longer to resolve. The callback is just not executed.

from cordova-plugin-geolocation.

janpio avatar janpio commented on May 28, 2024

@Gurjit-ONEBCG Nokia 6 and iOS 6 doesn't make sense. Do you mean Android 6 maybe?
@GPlay97 What platform and device are your experiences with?
@shokry055 What platform and device? What does return code 3 TO mean?

from cordova-plugin-geolocation.

carliblaz avatar carliblaz commented on May 28, 2024

Well I have the same problem, if I check the logs:

11-16 11:28:17.404 3420 21768 I GCoreUlr: No valid location reports to store
11-16 11:28:18.365 20227 20554 D GeolocationPlugin: We are entering execute
11-16 11:28:23.382 20227 20554 D GeolocationPlugin: We are entering execute
11-16 11:28:28.418 20227 20554 D GeolocationPlugin: We are entering execute
11-16 11:28:32.525 3420 19568 I GCoreUlr: Filtering location: Location[g 45.XXXXXX,13.XXXXXX acc=3 et=+22h11m35s905ms alt=68.50113677978516 vel=0.07393644 mock {Bundle[{mockLocation=true}]}]
11-16 13:04:38.453 3420 6966 I GCoreUlr: Successfully inserted 1 locations

But Response is not OK :(

from cordova-plugin-geolocation.

janpio avatar janpio commented on May 28, 2024

"same problem" as who? Original poster said that "Getting location with high accuracy taking time more than 4 mins " - what you posted took 15 seconds from the timestamps.

from cordova-plugin-geolocation.

carliblaz avatar carliblaz commented on May 28, 2024

Ye it took 15s for triggering error with no response, there is one missing line there, when successfully get location:

11-16 13:04:38.453 3420 6966 I GCoreUlr: Successfully inserted 1 locations

from cordova-plugin-geolocation.

carliblaz avatar carliblaz commented on May 28, 2024

Another example:

11-16 13:22:49.058 17763 17858 D GeolocationPlugin: We are entering execute
11-16 13:22:54.077 17763 17858 D GeolocationPlugin: We are entering execute
11-16 13:22:59.101 17763 17858 D GeolocationPlugin: We are entering execute
11-16 13:23:02.264 3420 11768 I GCoreUlr: Filtering location: Location[g 45.XXXXXX,13.XXXXXX acc=1 et=+1d0h6m5s663ms alt=67.32038879394531 vel=0.4008691 mock {Bundle[{mockLocation=true}]}]
11-16 13:23:02.264 3420 11768 I GCoreUlr: No valid location reports to store
11-16 13:23:04.122 17763 17858 D GeolocationPlugin: We are entering execute

from cordova-plugin-geolocation.

UlisesCeca avatar UlisesCeca commented on May 28, 2024

No solution for this yet?

from cordova-plugin-geolocation.

janpio avatar janpio commented on May 28, 2024

@carliblaz What device and OS version are you using?
@UlisesCeca What problem exactly are you referring to? Until now there is no clear report with all data in this issue, so it is hard to solve anything.

from cordova-plugin-geolocation.

breautek avatar breautek commented on May 28, 2024

Closing due to lack of response.

from cordova-plugin-geolocation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.