Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 6 Dec 2011 18:37:53
Topic: New BlackBerry sample app
See more news »

Show Last Known Location

1 reply [Last post]
xger86x
User offline. Last seen 1 year 44 weeks ago. Offline
Joined: 02/11/2010

Hi, i have a problem using your library.

I use the code proposed in the Android Guide to show GPS location in map. The problem is the following:

If i fix first the GPS position and then i start the application, the marker isn't shown until i re-fix the position in the emulator (if i wait for XX secs the marker is not shown neither).

Is any way to get the last known position in order to show the marker with this position instead to wait for the GPS update its position?

I have tried this but it doesn't work:

lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Location l = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
WgsPoint wgs = new WgsPoint(l.getLongitude(), l.getLatitude());
marker.setLocation(wgs);

Thanks