Get continuous GPS readings using the cell site mode
- Import the following classes:
- javax.microedition.location.LocationProvider
- javax.microedition.location.Location
- Create an instance of a LocationProvider object.
LocationProvider provider = new LocationProvider();
- 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.