Package com.iizix.geo

Class BackgroundLocationConfiguration

java.lang.Object
com.iizix.geo.BackgroundLocationConfiguration

public class BackgroundLocationConfiguration extends Object
Class used to hold the information required for the background location service.
Author:
Christopher Mindus
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks for equality.
    int
    Desired accuracy in meters.
    int
    The minimum distance (measured in meters) a device must move horizontally before an update event is generated (see Apple docs).
    long
    Gets the minimum time interval between location updates in milliseconds.
    boolean
    [Android Only] Start background service on device boot.
    int
    Stationary radius in meters.
    boolean
    Enable this in order to force a stop() when the application terminated (e.g.
    int
    Hash code.
    boolean
    Gets the use of the background mode, i.e.
    void
    setBackgroundMode(boolean useBackgroundMode)
    Sets the use of the background mode, i.e.
    String representation of the class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BackgroundLocationConfiguration

      public 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).
    • BackgroundLocationConfiguration

      public 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

    • setBackgroundMode

      public 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 -
    • isBackgroundModeUsed

      public boolean isBackgroundModeUsed()
      Gets the use of the background mode, i.e. the plugin that sends location data even when program is not running.
    • getDesiredAccuracy

      public 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.
    • getStationaryRadius

      public 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.
    • getDistanceFilter

      public int getDistanceFilter()
      The minimum distance (measured in meters) a device must move horizontally before an update event is generated (see Apple docs).
    • getInterval

      public long getInterval()
      Gets the minimum time interval between location updates in milliseconds. Android docs for more information.
    • getStopOnTerminate

      public 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)
    • getStartOnBoot

      public boolean getStartOnBoot()
      [Android Only] Start background service on device boot. (default false).
    • equals

      public boolean equals(Object o)
      Checks for equality.
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare with.
      Returns:
      When equals, false otherwise.
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Returns the hash code.
    • toString

      public String toString()
      String representation of the class.
      Overrides:
      toString in class Object
      Returns:
      A string with user and distance.