Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Deepu_George_Jacob
Posts: 234
Registered: ‎12-13-2011
My Device: Curve 9380
My Carrier: Vodafone-IN

How get varying GPS cordinates in MainScreen?

Hai,

      I am beginer in blackberry java development. I am using thread to get contionous gps fix. I need to tranfer it to main screen into a label..Please help me.

 

Thanks Regards 

     Deepu

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: How get varying GPS cordinates in MainScreen?

What exactly are you having problems with?

 

Have you managed to convert the location to a String you want to display?  Have you passed a referecnce to the label you want to update to your location processing?

Please use plain text.
Developer
Deepu_George_Jacob
Posts: 234
Registered: ‎12-13-2011
My Device: Curve 9380
My Carrier: Vodafone-IN

Re: How get varying GPS cordinates in MainScreen?

yes absolutely  right......

Please use plain text.
Developer
Deepu_George_Jacob
Posts: 234
Registered: ‎12-13-2011
My Device: Curve 9380
My Carrier: Vodafone-IN

Re: How get varying GPS cordinates in MainScreen?

I managed to convert the location to a String I want to display as label

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: How get varying GPS coordinates in MainScreen?

Assuming that you have reference to the label that your GPS processing can reference, then code like this will do it:

 

// LabelField is call la

// location String is in locString

// this is the code

UiApplication.getUiApplication().invokeLater(new Runnable() {

public void run() {

lab.setText(locString);

}

});

 

If this does not work for you,can you please give a more detailed description of the problem you are having.

 

Note however that the more common way to implement this sort of processing is to use the Observer Pattern - in other words to have a current location displayed on your Screen, the Screen will register itself as an Observer of location changes to your Location Thread.  Read up on Observer Pattern to understand this. 

Please use plain text.