Retrieve location information from GPS satellites and the GPS receiver on a BlackBerry device

  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.setCostAllowed(false) to specify that this mode does not incur cost.
  4. Invoke LocationProvider.getInstance(), storing the returned object in a LocationProvider object.
    LocationProvider provider = LocationProvider.getInstance(criteria);

Was this information helpful? Send us your comments.