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

Testing and Deployment

Simulating GPS location

by Developer on ‎07-29-2010 04:38 PM - edited on ‎09-20-2010 05:22 PM by Retired (5,158 Views)
<H2>Symptoms</H2>

The BlackBerry® Smartphone Simulator always returns 0 for both latitude and longitude.

<H2>Diagnosis</H2>

You haven't turned GPS simulation on in the BlackBerry Smartphone Simulator.

<H2>Solution</H2>

For any BlackBerry Smartphone Simulator that supports GPS, there is an option to simulate your GPS location, as shown in Figure A below (Simulate --> GPS Location...):

 

Figure A

 

Using the GPS Simulator:

 

Once you have selected the option, you will see the following window appear:

 

Figure B

 

If the "Location" ComboBox is not empty, the simulator will assume that the BlackBerry device is stationary at the coordinates associated with that device. You can add or edit a location by clicking the buttons directly below the ComboBox. When you do, the following dialog will appear:

 

Figure C

 

A minimum of 3 satellites is required to obtain any GPS fix, but you can set the value to any reasonable number above that value. Once you have named your location, and entered the coresponding latitude, longitude, and altitude, click Save. You will then be able to see you new location in the "Location" ComboBox. Any existing location can be removed from the list by selecting it and clicking the Delete button.

 

If you want the device to simulate movement, you need to select a route from the "Route" ComboBox and click the Play button. The device will then simulate travelling along the selected route until it has finished its journey, at which point the route simulation will end and the device will return to the selected location. Adding a route can be done using 3 different methods: You can generate a random route (Figure D), add a route stored in a file (at this time, I'm not sure what the proper format or extension is), or add a route between existing locations (Figure E).

 

Figure D

 

Figure E

 

For generating a random route, you may specify a start and end point to the journey, or just leave them as random. You must specify the number of legs of the journey (any distance travelled in a straight line is considered a leg), as well as the total travel time for the trip. Various positions will be automatically generated based on the seed criteria you provide, and will be listed as "Generated Route" in the "Route" ComboBox.

 

For adding a route using existing locations, you need to select each stop point individually from the "Start Location" ComboBox. The first location in the list will be the starting point. Once you have selected the location for that position in the list, you can start adding legs by clicking the Insert button. The Speed value determines the speed that the device will be travelling at from the selected location until it hits the next stop location in the list. Once you have a journey you are satisfied with, name your route and click Save. The route will now appear with the given name in the Route ComboBox.

Comments
by BlackBerry Development Advisor
on ‎06-11-2010 09:54 AM

Ready for publication.

Users Online
Currently online: 15 members 463 guests
Please welcome our newest community members: