Retrieve GPS information during a call
You can permit a BlackBerry® device application to obtain GPS information while a BlackBerry device user is on a phone call.
- Import the following classes:
- javax.microedition.location.LocationProvider
- javax.microedition.location.Criteria
- Create an instance of the Criteria class.
Criteria criteria = new Criteria();
- Configure the Criteria object to obtain GPS information without using a wireless network.
- Invoke Criteria.setCostAllowed() using the Boolean value of false as a parameter
to configure that a BlackBerry device cannot incur any costs.
criteria.setCostAllowed(false);
- Invoke the LocationProvider.getInstance() method using a Criteria object as a parameter
that you configure to obtain GPS information without using a wireless network. Assign the value that the method returns to a LocationProvider variable.
LocationProvider provider = LocationProvider.getInstance(criteria);
Was this information helpful? Send us your comments.