Phonegap Android Geolocation watchPosition timeout

前端 未结 5 1595
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 10:11

I am using Cordova 3.0.0, A Samsung Galaxy S3 4.1.2 to test.

When I test the Phonegap full example for watching position : http://docs.phonegap.com/en/edge/cordova_g

5条回答
  •  囚心锁ツ
    2021-01-03 11:08

    Ok, so after hours of tests, I managed to make the watchPosition work on Android with Cordova 3.1.0 .

    What you have to do: Use the html5 only api for geolocation and do not include this : http://cordova.apache.org/docs/en/3.1.0/cordova_geolocation_geolocation.md.html#Geolocation

    If you already have it in your projet, remove it via the CLI : cordova plugin rm org.apache.cordova.geolocation

    Of course, keep those lines in your android manifest :

    < uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    < uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    < uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    

    This is working for me, so tell me if its working for you. I will post code if you need ( but the cordova full example works for example )

提交回复
热议问题