Dear Android Developers
I am getting the following error when I try to request location updates using the android emulator:
01-11 17:48:51.972: ERROR/LocationManagerService(542): requestUpdates got exception:
01-11 17:48:51.972: ERROR/LocationManagerService(542): java.lang.IllegalArgumentException: provider=network
01-11 17:48:51.972: ERROR/LocationManagerService(542): at com.android.server.LocationManagerService.requestLocationUpdatesLocked(LocationManagerService.java:1000)
01-11 17:48:51.972: ERROR/LocationManagerService(542): at com.android.server.LocationManagerService.requestLocationUpdates(LocationManagerService.java:968)
01-11 17:48:51.972: ERROR/LocationManagerService(542): at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:96)
01-11 17:48:51.972: ERROR/LocationManagerService(542): at android.os.Binder.execTransact(Binder.java:287)
01-11 17:48:51.972: ERROR/LocationManagerService(542): at dalvik.system.NativeStart.run(Native Method)
I am using this to get the location:
lastlocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
For more information: I am using Android 1.5, minSDK: 3, the emulator is gps enabled, this is my first application: a simple cell phone locator.
I don’t think you can get a network location from the emulator using the Network provider. Try using the GPS provider and then in the DDMS perspective in Eclipse, you can ‘simulate’ a location update by pressing the send button (see below):
Hope this helps.