Get continuous GPS readings using the cell site mode

  1. Import the following classes:
    • javax.microedition.location.LocationProvider
    • javax.microedition.location.Location
  2. Create an instance of a LocationProvider object.
    LocationProvider provider = new LocationProvider();
  3. Invoke the LocationProvider.getLocation() method within code that simulates the retrieval of GPS information at fixed intervals. Assign the value that the method returns to a Location variable.
    Location loc = provider.getLocation(-1);

Was this information helpful? Send us your comments.