Archived:Different Location API methods return different coordinates from NMEA files in the S60 SDKs (Known Issue)
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
Compatibility
S60 3rd Edition FP1 SDK
S60 3rd Edition FP2 SDK
S60 5th Edition SDK
Article
Description
There are two ways to get coordinates by using the Location API (JSR-179):
- Asking coordinates "manually" by using the LocationProvider.getLocation() method and
- 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.
Solution
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.

