I want to configure location settings such a way that first priority to get current location using GPS, If GPS is not available than get network provider's location otherwise not.
Currently I am getting netwrok provider's settings only.
I have set android menifest as below:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
Sencha code to get GEO location:
Ext.create('Ext.util.Geolocation',
autoUpdate: true,
allowHighAccuracy: true,
frequency: '3000',
listeners: {
locationupdate: function(geo) {
latitude=geo.position.coords.latitude;
longitude=geo.position.coords.longitude;
if(Global.currentUserPositionMarker)
{
latlng1=new google.maps.LatLng(latitude, longitude);
currentPosMarker.setPosition(latlng1);
}
}
}
});
I am using sencha 2.3.1, phonegap 2.8.0, android sdk 4.4.2 (API 19).
来源:https://stackoverflow.com/questions/22227147/android-can-i-set-first-priority-to-gps-to-get-current-location-in-google-map