Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:Different Location API methods return different coordinates from NMEA files in the S60 SDKs (Known Issue)

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Using NMEA files for simulating movement in S60 3rd and 5th Edition SDKs does not work reliably. These SDKs handle NMEA files in a different way, depending on the method for getting coordinates. In real devices these different methods return similar coordinates correctly.

Article Metadata
Tested with
Devices(s): Emulator
Platform(s): S60 3rd Edition SDK
S60 3rd Edition FP1 SDK
S60 3rd Edition FP2 SDK
S60 5th Edition SDK
S60 5th Edition
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Keywords: LocationProvider, getLocation
Created: User:Technical writer 1 (25 Feb 2009)
Last edited: hamishwillee (26 Jun 2013)


There are two ways to get coordinates by using the Location API (JSR-179):

  1. Asking coordinates "manually" by using the LocationProvider.getLocation() method and
  2. Waiting for location update by using LocationListener and its locationUpdated() method. In real devices both ways should return the same values. In the S60 SDKs this is simulated by using NMEA files, which contain the coordinates and other GPS information. If the first method is used for getting the coordinates, the method always returns the first coordinates from the NMEA file (thus not indicating any kind of movement). The second method simulates movement and reads the coordinate values properly from the NMEA file.

How to reproduce

Ask continuously for the location by using the LocationProvider.getLocation() method in a thread as shown in this example: How to implement a compass in Java ME. Follow the coordinate values and note that they do not change.


Instead of the first way of getting coordinates, use the second one (LocationListener and its locationUpdated() method). This problem can also be avoided by using real devices for testing.

This page was last modified on 26 June 2013, at 05:48.
41 page views in the last 30 days.