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 Link icon

    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 Link icon

    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 Link icon

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

    • BackgroundLocationConfiguration Link icon

      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 Link icon

      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 Link icon

    • setBackgroundMode Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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

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

      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 Link icon

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

      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 Link icon

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

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