Namespaces
Variants
Actions
Revision as of 07:41, 1 August 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Jump to: navigation, search
Archived.png
Archived: 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.

SignpostIcon MapAndLocation 52.png
SignpostIcon Tools1 52.png
Article Metadata

Tested with
Devices(s): Emulator

Compatibility
Platform(s): S60 3rd Edition SDK
S60 3rd Edition FP1 SDK
S60 3rd Edition FP2 SDK
S60 5th Edition SDK

Article
Keywords: LocationProvider, getLocation
Created: User:Technical writer 1 (25 Feb 2009)
Last edited: hamishwillee (01 Aug 2012)

Description

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.

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.

277 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved