View Full Version : Issue with Android geolocation...

22 Dec 2010, 9:45 PM
Hello everyone - loving Sencha...absolutely incredible! I am...of course having an issue or wouldn't be posting :)

Any help on the following would be much appreciated - I'm sure it is something stupid but I cannot find the issue anywhere.

I am doing a geolocation on a map object. Everything works wonderfully in the iPhone (3, 3g, 4), iPad, etc. Android for some reason will not locate at all. This only seems to have become an issue in some of the later Sencha releases, however, I'm not exactly sure when it stopped working!

I have used the android emulator and ADB - and have looked in the console and am getting the following error when trying to invoke the geolocation from android...

E/LocationManagerService( 51): requestUpdates got exception: E/LocationManagerService( 51): java.lang.IllegalArgumentException: provider=network E/LocationManagerService( 51): at com.android.server.LocationManagerService.requestLocationUpdatesLocked(LocationManagerService.java:861) E/LocationManagerService( 51): at com.android.server.LocationManagerService.requestLocationUpdates(LocationManagerService.java:831) E/LocationManagerService( 51): at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:79) E/LocationManagerService( 51): at android.os.Binder.execTransact(Binder.java:287) E/LocationManagerService( 51): at dalvik.system.NativeStart.run(Native Method)

Has anyone experienced this or have any thoughts?


25 Jan 2011, 12:18 PM
I'd like to get an answer to this too... I am having the same problem, geolocation works on iPhone but not Android.

3 Jul 2011, 4:41 AM
I think there is a bad evaluation for GeoLocation provider in original code.

To fix that in your code when you initiate Ext.util.GeoLocation object specify manually the provider: navigator.geolocation

this.geo = new Ext.util.GeoLocation({
provider: navigator.geolocation ? navigator.geolocation : google.gears.factory.create('beta.geolocation'),
listeners: {
locationupdate: function (geo) {
locationerror: function ( geo,
message) {
console.error('Timeout occurred.');
console.error('Error occurred. '+message);