This class provides a helper to get the best location. More...
Static Public Member Functions | |
static void | setLocationManager (LocationManager locationManager) |
Set the LocationManager needed by the helper to be able to take care of the location. More... | |
static void | addGeoObjectLocationUpdate (GeoObject geoObject) |
Add a GeoObject that will be updated with the user location. More... | |
static void | removeGeoObjectLocationUpdate (GeoObject geoObject) |
Remove the specified GeoObject to don't get any update about the user location. More... | |
static void | removeAllGeoObjectsUpdates () |
Remove all the GeoObject to get the location updates. | |
static void | addWorldLocationUpdate (World world) |
Add a World object that will be updated with the user location. More... | |
static void | removeWorldLocationUpdate (World world) |
Remove the specified World to don't get any update about the user location. More... | |
static void | removeAllWorldsUpdates () |
Remove all the World to get the location updates. | |
static void | addLocationListener (LocationListener locationListener) |
Add a LocationListener object that will be updated with the user location. More... | |
static void | removeLocationListener (LocationListener locationListener) |
Remove the specified LocationListener to don't get any update about the user location. More... | |
static void | removeAllLocationListener () |
Remove all the LocationListener to get the location updates. | |
static void | enable () |
Enable the location services for the helper. More... | |
static void | disable () |
Disable the location services for the helper. More... | |
static boolean | isEnabled () |
Check if location is enabled or not. More... | |
static boolean | gpsFix () |
Check if the satellites are giving a correct location. More... | |
Static Public Attributes | |
static final int | MAX_TIME_GPS_FIX = 20000 |
This class provides a helper to get the best location.
To do that the application needs to add the following permissions in the manifest:
android.permission.ACCESS_FINE_LOCATION android.permission.ACCESS_COARSE_LOCATION
Remember that you also can use the Location utility in the Google Services.
Here is a small example how to use BeyondarLocationManager:
void onCreate(Bundle savedInstanceState){
BeyondarLocationManager.setLocationManager((LocationManager) this.getSystemService(Context.LOCATION_SERVICE));
BeyondarLocationManager.addGeoObjectLocationUpdate(beyondarObject);
// You also can register a World or a LocationListener
// Don't forget to remove the object that you register
}
void onResume(){
BeyondarLocationManager.enable();
}
void onPause(){
BeyondarLocationManager.disable();
}
|
static |
Add a GeoObject that will be updated with the user location.
geoObject |
|
static |
Add a LocationListener object that will be updated with the user location.
locationListener |
|
static |
Add a World object that will be updated with the user location.
world |
|
static |
Disable the location services for the helper.
If the location is not needed use this method in order to save battery.
|
static |
Enable the location services for the helper.
Once it will be enabled it will start consuming battery.
|
static |
Check if the satellites are giving a correct location.
|
static |
Check if location is enabled or not.
|
static |
Remove the specified GeoObject to don't get any update about the user location.
geoObject |
|
static |
Remove the specified LocationListener to don't get any update about the user location.
locationListener |
|
static |
Remove the specified World to don't get any update about the user location.
world |
|
static |
Set the LocationManager needed by the helper to be able to take care of the location.
locationManager |