Package com.iizix.geo

Class BackgroundLocationConfiguration


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

      Constructors 
      ConstructorDescription
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      booleanequals​(java.lang.Object o)
      Checks for equality.
      intgetDesiredAccuracy()
      Desired accuracy in meters.
      intgetDistanceFilter()
      The minimum distance (measured in meters) a device must move horizontally before an update event is generated (see Apple docs).
      longgetInterval()
      Gets the minimum time interval between location updates in milliseconds.
      booleangetStartOnBoot()
      [Android Only] Start background service on device boot.
      intgetStationaryRadius()
      Stationary radius in meters.
      booleangetStopOnTerminate()
      Enable this in order to force a stop() when the application terminated (e.g.
      inthashCode()
      Hash code.
      booleanisBackgroundModeUsed()
      Gets the use of the background mode, i.e.
      voidsetBackgroundMode​(boolean useBackgroundMode)
      Sets the use of the background mode, i.e.
      java.lang.StringtoString()
      String representation of the class.
      • Methods inherited from class java.lang.Object

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

      • 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:
        java.lang.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:
        java.lang.IllegalArgumentException - If the parameters are invalid (negative values not allowed and interval cannot be zero).
    • Method Detail

      • 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).
      • 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​(java.lang.Object o)
        Checks for equality.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The object to compare with.
        Returns:
        When equals, false otherwise.
      • hashCode

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

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