Single location fix in a specified mode:
try{ simpleProvider = new SimpleLocationProvider(SimpleLocationProvider.MODE_GPS); } catch(LocationException le){ // thrown if the selected mode (in this case {@link #MODE_GPS}) is not available. ... } BlackBerryLocation location = simpleProvider.getLocation(120); // 120 seconds timeout
Tracking session in default mode
try{ simpleProvider = new SimpleLocationProvider(); } catch(LocationException le){ // thrown if the default mode {@link #MODE_OPTIMAL} is not available.... } // Location fixes will be delivered to simpleLocationListenerImpl (an implementation of {@link SimpleLocationListener}) every 6 seconds. simpleProvider.addSimpleLocationListener(simpleLocationListenerImpl, 6);
Tracking session in a specific mode
try{ simpleProvider = new SimpleLocationProvider(SimpleLocationProvider.MODE_GPS); } catch(LocationException le){ // thrown if the selected mode (in this case {@link #MODE_GPS}) is not available. ... } // Location fixes will be delivered to simpleLocationListenerImpl (an implementation of {@link SimpleLocationListener}) every 6 seconds. simpleProvider.addSimpleLocationListener(simpleLocationListenerImpl, 6);@author Shadid Haque
|
|
|
|