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: 75
Registered: ‎04-07-2009
My Device: Not Specified
Accepted Solution

How to get Current GPS Location from the BlackBerry emulator?

Hi! all, I write a simple programm to get the current GPS coordinates (Latitude, Longitude) in BlackBerry.

Criteria criteria=new Criteria(); criteria.setHorizontalAccuracy(500); criteria.setVerticalAccuracy(500); LocationProvider locationProvider=LocationProvider.getInstance(criteria); Location location=locationProvider.getLocation(60); QualifiedCoordinates coordinates=location.getQualifiedCoordinates(); System.out.println("Latitude : "+coordinates.getLatitude()+" Longitude : "+coordinates.getLongitude());

 

But, I couldn't get the latitude, and longitude. It returns 0 (zero) for both coords.

Pls, suggest me the solution.

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

Re: How to get Current GPS Location from the BlackBerry emulator?

Are you running the GPS simulator? You can find it under Simulator ->Simulate ->GPS.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 75
Registered: ‎04-07-2009
My Device: Not Specified

Re: How to get Current GPS Location from the BlackBerry emulator?

How, we can find the whether the current running simulator is GPS or not? Pls, help me----
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to get Current GPS Location from the BlackBerry emulator?

Which Simulator or JDE you talking about. Recent Simulators does support the GPS on Simulator.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 75
Registered: ‎04-07-2009
My Device: Not Specified

Re: How to get Current GPS Location from the BlackBerry emulator?

I used BlackBerry 9000 Simulator, and develop application using Eclipse JDE plugin 4.5.0_16---

Pls, help me to get the GPS coordinates.

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to get Current GPS Location from the BlackBerry emulator?

The 9000 simulator has GPS simulation. From the "Simulate" menu of the simulator, select "GPS". There is a test location already defined, you'll have to select this location.

 

New Developer
Posts: 75
Registered: ‎04-07-2009
My Device: Not Specified

Re: How to get Current GPS Location from the BlackBerry emulator?

I tried ur suggestion, select the GPS in the simulator. Eventhough,I couldn't get the GPS coords.
New Developer
Posts: 75
Registered: ‎04-07-2009
My Device: Not Specified

Re: How to get Current GPS Location from the BlackBerry emulator?

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

Re: How to get Current GPS Location from the BlackBerry emulator?

Is it still showing the zero co-oridnate values? If you are running the GPS simulator it should not be the case.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 75
Registered: ‎04-07-2009
My Device: Not Specified

Re: How to get Current GPS Location from the BlackBerry emulator?

Yes,

Can u pls tell me again the way how to configure GPS service on emulator.

Pls,

Thanks in advance...