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
New Developer
Posts: 6
Registered: ‎10-07-2008
My Device: Not Specified
Accepted Solution

Get GPS Latitude and Longitude from Contact

I am stuck with this problem.

 

I want to get the GPS latitude and longitude from contact object.

 

Can any one post related code.??

 

Regards,

Vinay H V

 

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Get GPS Latitude and Longitude from Contact

Hi, Please refer to the guide "GPSandBlackBerryMapsDevelopmentGuide.pdf". It has the code snippets.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 6
Registered: ‎10-07-2008
My Device: Not Specified

Re: Get GPS Latitude and Longitude from Contact

Thanks for the suggestion. But I am not able to create locator object

 

Locator lo = new Locator();

this gives error "Locator() has private access in net.rim.device.api.lbs.Locator"

 

I want an example on how to use locator object.

 

Regards,

Vinay H V

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Get GPS Latitude and Longitude from Contact

[ Edited ]

Hi,

Did you try using direct Locator class... like Locator.geocode(.......) or Locator.cancel().

 

Tnx.

Message Edited by BBDeveloper on 10-22-2008 11:49 AM

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 6
Registered: ‎10-07-2008
My Device: Not Specified

Re: Get GPS Latitude and Longitude from Contact

strAddress = "02903 USA";

Locator.geocode(strAddress,null);

 

Coordinates co = new Coordinates(41.34564,-71.45632);

Locator.geocode(strAddress,co);

 

 

I tried using Locator class directly as above. But Simulator is getting stuck after that statement.

 

I tried creating a new thread and calling Locator.geocode(). This is also giving same problem.

 

Can anyone help me with this.

 

BlackBerry Development Advisor
Posts: 15,723
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Get GPS Latitude and Longitude from Contact

That call can run in the BlackBerry Simulator, but does require a network connection be made.  Do you have a firewall or proxy server that could be blocking this connection?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Highlighted
New Developer
Posts: 6
Registered: ‎10-07-2008
My Device: Not Specified

Re: Get GPS Latitude and Longitude from Contact

Thanks for suggestion

 

My code is working fine now.

I was invoking Blackberry map application in the main after thread returns.

Now i m invoking BB map application after invoking

 

landmarkArray = Locator.geocode(_search, null);  

 

in the thread itself. This is working fine.

 

Thank you all,

Vinay H V

Developer
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: Get GPS Latitude and Longitude from Contact

Can you post some of your code? i'm finding a similar problem, I tried everything about the thread and i don't get anything.