Hi all,
I am using the below code to get current location, it is working in all device excpet in samsung galaxy note 10, It always go to error section of getcurrent location and error message is 'cannt get your current locatlion'
but when i open the google map, the getcurrent location works and when i restart the application the getcurrentlocation again shows error. Every time i need to open the google map to make the getcurrentlocation workable.
Ti.Geolocation.preferredProvider = Titanium.Geolocation.PROVIDER_GPS; Ti.Geolocation.purpose = "Get current position"; //Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; //Titanium.Geolocation.distanceFilter = 10; //Ti.Geolocation.trackSignificantLocationChange = true; Titanium.Geolocation.getCurrentPosition(function(e) { if (e.error) { return; } var longitude = e.coords.longitude; var latitude = e.coords.latitude; var altitude = e.coords.altitude; var heading = e.coords.heading; var accuracy = e.coords.accuracy; var speed = e.coords.speed; var timestamp = e.coords.timestamp; var altitudeAccuracy = e.coords.altitudeAccuracy; Ti.API.info('speed ' + speed); Titanium.API.info('geo - current location: ' + new Date(timestamp) + ' long ' + longitude + ' lat ' + latitude + ' accuracy ' + accuracy); Titanium.Geolocation.addEventListener('location', function(e) { Ti.API.info('speed ' + speed); Titanium.API.info('geo - current location: ' + new Date(timestamp) + ' long '); }); if (screenWidth > 320 || screenHeight > 480) { var pinAimg = Ti.App.getResourceFile('images/favouritePinBig.png'); } else { var pinAimg = Ti.App.getResourceFile('images/favlocationpin.png'); }