locationmanager,getLatitude function

by CSUIDL PROGRAMMEr » Thu, 23 Oct 2008 19:31:57 GMT

Sponsored Links
I am a newbie android developer. I am trying to simulate gps
functionality in android sdk 1.0.

I am using location manager  to get getlatitude function.


I am loading a google kml  through my ddms.

I get a java null pointer exception.
What am i doing wrong here



locationmanager,getLatitude function

by Mast3rpyr0 » Thu, 23 Oct 2008 21:19:09 GMT

 does getLastKnownLocation have a location to give yet? try running
maps first then run your app


Sponsored Links

locationmanager,getLatitude function

by nkijak » Thu, 23 Oct 2008 21:24:48 GMT


I updated your code on that site to be more "correct". You should
stick with the static variable instead of hardcoding the string "gps".

You get a null pointer because you have to provide a location first,
meaning run the KML, then you can call getLastKnownLocation. When the
emulator starts, without being given a coordinate, it has no last
location. So try running the KML then running your app.

If you are trying to get continuous updates of location you should
implement LocationListener instead.



locationmanager,getLatitude function

by CSUIDL PROGRAMMEr » Mon, 03 Nov 2008 12:26:17 GMT

 Hello nkijak,
I could not find your upated code.
Also, i tried running the maps, ( including kml file, manually sending
decimal) .But the Nullpointer exception exists.
Is there anyone here who as got gps simulation working in android


Other Threads

1. Android-BootTime

Hi Developers,

                                I am doing one project there i got struck at
one point. i need to know hardware processing time like Boot time, Time to
enter/exit standby ,Application launch time etc.
 Thank you in advance



2. TCP version for Android


Which TCP version is used in Android kernel? Westwood ?

Thanks a lot.


3. Rounded Rectangle with one side missing

4. Building kernel and loading with Emulator

5. how to make a boot-disk?

6. Conflict in to MapController between Zoom Level and AnimateTo ?

7. Invalidating a Canvas view that is part of setContentView()