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

Latest news

Last at Mon, 6 Sep 2010 12:27:06
Topic: Let your feedback ideas flow
See more news »

Nutiteq on Twitter

12 weeks 2 days ago Nutiteq is proud sponsor of StateOfTheMap 2010 #sotm10

Update point from a different thread

2 replies [Last post]
wbasheer
User offline. Last seen 10 weeks 2 days ago. Offline
Joined: 06/29/2010

I am writing an app that receives GPS data through SMS which is intercepted using a Listening thread that is running at startup of the phone. This listener will notify the user with an icon on the home screen where the user will then open up the user interface portion. Now while the map is already up and an SMS is received, the map should be updated with the new point.

I have tried everything to do the following:

in the MainScreen class:


void updateDisplay()
{
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
addPoint();
}
});
}

In the Listening Thread, I just call screen.updateDisplay().

Is this the right method to update the map because currently this doesn't work so can you suggest a better way to go about what we want to achieve?

Thanks.

jaak
User offline. Last seen 7 hours 16 min ago. Offline
Joined: 06/19/2008

This seems to be a bit too BlackBerry API specific issue, not specific to our mapping tookit. I'm not sure if we could assist you here.

/JaakL

dexy
User offline. Last seen 3 weeks 13 hours ago. Offline
Joined: 08/18/2010

it seems you have 2 applications, one that is started at startup to listen to the sms, and the other one, the UI portion that is run by the user.

You want the other application(the listener app to update something on UI app.) You cannot simply do that by UiApplication.getUiApplication().invokeLater(new Runnable(), because your listenerapplication is not a UI app, even if it is, the method will return the UI thread of the listener app, not the user UI app. because they are 2 separate apps.

What you need to do is to pass the point or lat/long as an object to the other application. i.e you need to intercommunicate between the apps.

The Blackberry runtime store does this perfectly. You put an object in the runtime store from the Listener app, then retrieve it from the runtime store with the UI app. See the rim java forum for a lot of examples using the runtime store.