Retrieve location information from cell site towers

  1. Import the following classes:
    • javax.microedition.location.LocationProvider
    • javax.microedition.location.Criteria
  2. Create an instance of a Criteria object.
    Criteria criteria = new Criteria();
  3. Invoke criteria.setHorizontalAccuracy(NO_REQUIREMENT) to specify that longitudinal accuracy is not required.
  4. Invoke criteria.setVerticalAccuracy(NO_REQUIREMENT) to specify that latitudinal accuracy is not required.
  5. Invoke criteria.setCostAllowed(true) to specify that this mode can incur costs for the BlackBerry® device user.
  6. Invoke setPreferredPowerConsumption(POWER_USAGE_LOW) to specify that power consumption is low.
  7. Invoke LocationProvider.getInstance(), storing the returned object in a LocationProvider object.
    LocationProvider provider = LocationProvider.getInstance(criteria);

Was this information helpful? Send us your comments.