Retrieve location information from cell site towers
- Import the following classes:
- javax.microedition.location.LocationProvider
- javax.microedition.location.Criteria
- Create an instance of a Criteria object.
Criteria criteria = new Criteria();
- Invoke criteria.setHorizontalAccuracy(NO_REQUIREMENT) to specify that longitudinal accuracy is not required.
- Invoke criteria.setVerticalAccuracy(NO_REQUIREMENT) to specify that latitudinal accuracy is not required.
- Invoke criteria.setCostAllowed(true) to specify that this mode can incur costs for the BlackBerry® device user.
- Invoke setPreferredPowerConsumption(POWER_USAGE_LOW) to specify that power consumption is low.
- Invoke LocationProvider.getInstance(), storing the returned object in a LocationProvider object.
LocationProvider provider = LocationProvider.getInstance(criteria);
Was this information helpful? Send us your comments.