Software Archive
Read-only legacy content
17061 Discussions

cordova-plugin-geolocation don't work in Android 6

Andrejs_V_
Beginner
468 Views

So, found new problem:

cordova-plugin-geolocation don't work in Android 6.

 

checking navigator.geolocation get OK, but

navigator.geolocation.getCurrentLocation don't work.

function start , but don't return anything, nor success , nor error nor don't support.

But code work fine in simulator.

Don't work in AppPreview .

I was created some biulds for absolutely new project and for my old working project and :

- They don't get locations in Android 6 , but fine work in Android 5 and 4

Tested in Huawei P9 Lite/Android 6 (2 phones)

Meizu M2Note/android 5

samsung S3 Neo ( Android 4.4)

0 Kudos
4 Replies
Andrejs_V_
Beginner
468 Views

Resolved

After upgrading from android 5 to Android 6 Waze freeze GPS invokation ...  (but Google Maps still work )  another apps (like weather and so on) don't locate with GPS

after Waze  full reinstallation  GPS start work and plugin also .....

 

===============

 

may be it will help somebody

0 Kudos
Andrejs_V_
Beginner
468 Views

The problem oocuring again on regular basis .

Reset device resolved problem , but only for some hours

0 Kudos
PaulF_IntelCorp
Employee
468 Views

Try using the "hello cordova" test app to experiment with geolocation. It rarely works the way you think it should work and is very dependent on the device you are using, the geolocation settings on that device, and geo permissions. Build the "hello cordova" app and install it on several different devices and you'll see what I mean.

Also, geo fine (versus coarse) might not work on some devices because of the following reasons:

  1. Your device does not have a GPS chip
  2. It is taking a long time to get a GPS lock (if you are indoors)
  3. The GPS on your device has been disabled in the mobile device settings

Geo coarse is the safest bet to quickly get an initial reading. It will get a reading based on a variety of inputs, but is usually not as accurate as geo fine but generally accurate enough to know what town you are located in and your approximate location in that town. Geo coarse will also prime the geo cache so there is something to read when you try to get a geo fine reading. Ensure your code can handle situations where you might not be getting any geo data as there is no guarantee you'll be able to get a geo fine reading at all or in a reasonable period of time. Success with geo fine is highly dependent on a lot of parameters that are typically outside of your control.

I have an Android 6 device and that geo plugin works just fine on it. Use the 'hello cordova' app for experimentation.

0 Kudos
Andrejs_V_
Beginner
468 Views

Hi All!

I try test Hello Cordova

Sorry, but this example in location use navigator.geolocation object ..... 

don't help me

at now try use old intel.xdk.geolocation plugin

 

 

 

0 Kudos
Reply