locationmanager,getLatitude function

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


Sponsored Links
 Hello,
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.

 http://pastebin.com/m56feb30c 

I am loading a google kml  through my ddms.

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

Thanks

--~--~---------~--~----~------------~-------~--~----~



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


 Hello,

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.

Nick



--~--~---------~--~----~------------~-------~--~----~



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
here.
Thanks




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Issue With Android EMail client when using Yahoo Imap

Hi,

I see the duplicated messages in my Sent folder when I do the Yahoo
Imap setup on my Droid. Is there any solution available for this issue
in 2.1?

I found that this issue is already being discussed at the below link,
but no solution is yet known.
http://code.google.com/p/android/issues/detail?id=4761

Thanks,
Runjita

-- 

2. How to get the real width of pixels of a string?

Well I have to admit I almost adore this problem description. You can
try Paint.measureText()
http://developer.android.com/reference/android/graphics/Paint.html





-- 

3. AudioRecord on Samsung Moment

4. How to get the real width of pixels of a string?

5. How to open new view (call an activity) from options menu defined in XML

6. Strange crashing while using OpenGL

7. Forward locking or copy protection outside the Marketplace