Hello,
I try to locate my position with this code that I see in your tutorial :
if (System.getProperty("microedition.location.version") != null) {
final LocationSource dataSource = new LocationAPIProvider(3000);
try {
final Image gpsPresentImage = Image.createImage("/def_kml.png");
final Image gpsConnectionLost = Image
.createImage("/def_kml.png");
final LocationMarker marker = new NutiteqLocationMarker(
new PlaceIcon(gpsPresentImage, 4, 16), new PlaceIcon(
gpsConnectionLost, 4, 16), 3000, true);
dataSource.setLocationMarker(marker);
mapComponent.setLocationSource(dataSource);
} catch (final IOException e) {
}
}
When I'm implementing the code and test on device, I don't have any result. I would know what the problem is.
Thanks,
Nomalys.
Hello Jaak,
I test on device (BB Torch 9800, Bold 9900, ...), not on emulator, the device support location API.
Can you activate SDK logging and get log messages. This could give hint what is happening there.
I would check:
1. Does device support location API
2. Any messages in console/logs
3. Is valid GPS data coming in - e.g. do other apps show location
I've seen that several emulators did not provide emulated GPS data, even if they in principle had this in menu, so changing emulator helped.
/JaakL