Retrieve the location information for a BlackBerry device
- Import the following classes:
- javax.microedition.location.LocationProvider
- javax.microedition.location.Location
- Create an instance of a LocationProvider.
LocationProvider provider = new LocationProvider();
- In a non-event thread, invoke LocationProvider.getLocation(int), providing a timeout, in seconds.
try {
Location location = provider.getLocation(-1);
} catch (Exception e) {
}
Was this information helpful? Send us your comments.