Search code examples
androidgpssencha-touch-2

How to get only gps location using sencha touch?


I have created sencha touch application and i want to try get the current location of android device using below code.

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);  
    }  
   }  
  }  
});  

In my device the gps icon will be blinking but Couldn't get the current location of device gps position. It always get current location from my network provider.
I want frequently update current location from the device gps possition. Like the google map app for android the gps icon is always stable, i want to like that in my application.


Solution

  • start your Device WI-FI and then try to load your app.
    Because It will work for me to get the current location from gps.
    I have face the same problem to get the current location from gps.
    I am also add question for releated these problem See The Question.