Package com.iizix.geo
Class BackgroundLocationConfiguration
java.lang.Object
com.iizix.geo.BackgroundLocationConfiguration
Class used to hold the information required for the background location service.
- Author:
- Christopher Mindus
- Constructor SummaryConstructorsConstructorDescription- BackgroundLocationConfiguration- (int desiredAccuracy, int stationaryRadius, int distanceFilter, long interval) Constructs the configuration for the location background service.- BackgroundLocationConfiguration- (int desiredAccuracy, int stationaryRadius, int distanceFilter, long interval, boolean stopOnTerminate, boolean startOnBoot) Constructs the configuration for the location background service.
- Method SummaryModifier and TypeMethodDescription- booleanChecks for equality.- intDesired accuracy in meters.- intThe minimum distance (measured in meters) a device must move horizontally before an update event is generated (see Apple docs).- longGets the minimum time interval between location updates in milliseconds.- boolean[Android Only] Start background service on device boot.- intStationary radius in meters.- booleanEnable this in order to force a stop() when the application terminated (e.g.- int- hashCode()Hash code.- booleanGets the use of the background mode, i.e.- void- setBackgroundMode- (boolean useBackgroundMode) Sets the use of the background mode, i.e.- toString()String representation of the class.
- Constructor Details- BackgroundLocationConfigurationpublic BackgroundLocationConfiguration- (int desiredAccuracy, int stationaryRadius, int distanceFilter, long interval) Constructs the configuration for the location background service.- Parameters:
- desiredAccuracy- Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower the number, the more power devoted to GeoLocation resulting in higher accuracy readings. 1000 results in lowest power drain and least accurate readings.
- stationaryRadius- Stationary radius in meters. When stopped, the minimum distance the device must move beyond the stationary location for aggressive background-tracking to engage.
- distanceFilter- The minimum distance (measured in meters) a device must move horizontally before an update event is generated (see Apple docs).
- interval- [Android Only] The minimum time interval between location updates in milliseconds. Android docs for more information.
- Throws:
- IllegalArgumentException- If the parameters are invalid (negative values not allowed and interval cannot be zero).
 
- BackgroundLocationConfigurationpublic BackgroundLocationConfiguration- (int desiredAccuracy, int stationaryRadius, int distanceFilter, long interval, boolean stopOnTerminate, boolean startOnBoot) Constructs the configuration for the location background service.- Parameters:
- desiredAccuracy- Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower the number, the more power devoted to GeoLocation resulting in higher accuracy readings. 1000 results in lowest power drain and least accurate readings.
- stationaryRadius- Stationary radius in meters. When stopped, the minimum distance the device must move beyond the stationary location for aggressive background-tracking to engage.
- distanceFilter- The minimum distance (measured in meters) a device must move horizontally before an update event is generated (see Apple docs).
- interval- [Android Only] The minimum time interval between location updates in milliseconds. Android docs for more information.
- stopOnTerminate- Enable this in order to force a stop() when the application terminated (e.g. on iOS, double-tap home button, swipe away the app). (default true)
- startOnBoot- [Android Only] Start background service on device boot. (default false)
- Throws:
- IllegalArgumentException- If the parameters are invalid (negative values not allowed and interval cannot be zero).
 
 
- Method Details- setBackgroundModepublic void setBackgroundMode- (boolean useBackgroundMode) Sets the use of the background mode, i.e. the plugin that sends location data even when program is not running.- Parameters:
- useBackgroundMode-
 
- isBackgroundModeUsedpublic boolean isBackgroundModeUsed()Gets the use of the background mode, i.e. the plugin that sends location data even when program is not running.
- getDesiredAccuracypublic int getDesiredAccuracy()Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower the number, the more power devoted to GeoLocation resulting in higher accuracy readings. 1000 results in lowest power drain and least accurate readings.
- getStationaryRadiuspublic int getStationaryRadius()Stationary radius in meters. When stopped, the minimum distance the device must move beyond the stationary location for aggressive background-tracking to engage.
- getDistanceFilterpublic int getDistanceFilter()The minimum distance (measured in meters) a device must move horizontally before an update event is generated (see Apple docs).
- getIntervalpublic long getInterval()Gets the minimum time interval between location updates in milliseconds. Android docs for more information.
- getStopOnTerminatepublic boolean getStopOnTerminate()Enable this in order to force a stop() when the application terminated (e.g. on iOS, double-tap home button, swipe away the app). (default true)
- getStartOnBootpublic boolean getStartOnBoot()[Android Only] Start background service on device boot. (default false).
- equalsChecks for equality.
- hashCodepublic int hashCode()Hash code.
- toStringString representation of the class.