29 Jan 2009, 22:48
Generic-user-small

martijn oost (1 post)

I am running the LocationTest app on the Android Emulator in Eclipse. When clicking the send button in the Emulator I get a null object in the onLocationChanged method although the LocationProvider is enabled
01-29 22:42:56.205: INFO/LocationTest(485): LocationProvider[name=gps,enabled=true,getAccuracy=fine,getPowerRequirement=high,hasMonetaryCost=false,requiresCell=false,requiresNetwork=true,requiresSatellite=true,supportsAltitude=true,supportsBearing=true,supportsSpeed=true]
What am I missing here ?

30 Jan 2009, 07:15
Generic-user-small

David G. Friedman (1 post)

It works on my setup without any problems. I am running Java version 1.6.0_11 with the latest Android X86 SDK version 1.0_r2 and the latest Eclipse 3.4.1. If you are not running these versions can you upgrade and try it again? I have had no problems running any book examples or examples with the SDK using this setup.

Regards,
David

02 Feb 2009, 03:46
Burnette_ed_pragsmall

Ed Burnette (1316 posts)

I’m unable to reproduce the problem. Can you get a traceback on the null exception?

24 Mar 2009, 01:02
Generic-user-small

Richard (2 posts)

LocationTest doesn’t work for me either. But LogCat doesn’t seem to be noticing any errors. Just:
03-24 00:54:47.974: ERROR/dalvikvm(4562): pthread_setspecific failed, err=22

While LocationTest doesn’t produce any errors and displays data fine it just never finds any locations:
onLocationChanged() is never called. Only thing that happens if I send Location Data manually in the emulator is that onStatusChanged() is called once.

Do I have to include more than:

Anybody got any ideas?

26 Mar 2009, 03:39
Burnette_ed_pragsmall

Ed Burnette (1316 posts)

That should be enough. The pthread message is probably a red herring

When you change the position, you’re using the Emulator Control view and you’re changing it to a position far away from the last position, right? If it’s close by then you won’t get a location changed event.

Try downloading the source from the example code zip file instead of typing it in and see if that helps. The example works on real devices and it works in the emulator for most people. I don’t understand why it doesn’t work for the two of you.

27 Mar 2009, 13:01
Generic-user-small

Richard (2 posts)

To my utter amazement it does work on the real device. Just like that. ;)
Well that solves the problem for me. As to why it doesn’t work on my emulator I can only speculate that it doesn’t work because of some premissions in windows that I didn’t set…

26 May 2009, 14:06
Burnette_ed_pragsmall

Ed Burnette (1316 posts)

Glad it’s working for you now.

  You must be logged in to comment