I created a sencha touch application and I want to try to get the current location of an Android device using the code below.
Ext.create('Ext.util.Geolocation',
autoUpdate: true,
allowHighAccuracy: true,
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);
}
}
}
});
On my device, the gps icon will flash, but could not get the current location of the gps position of the device. It always gets the current location from my network provider.
I want to frequently update the current location from a gps device. Like the google map app for Android, the gps icon is always stable, I want it in my app.
source
share