Class IALocationRequest

  • All Implemented Interfaces:
    Parcelable

    public final class IALocationRequest
    extends Object
    implements Parcelable

    Provides quality of service attributes to the IALocationManager. All values are optional, to use default values pass IALocationRequest returned from create()

    Similarly to Android's LocationRequest API, IALocationRequest can be used to set fastest interval which controls the frequency of the received locations timewise. Smallest displacement can be used to control the frequency with respect to displacement or change in the coordinates. If both the fastest interval and smallest discplacement are used together, both conditions are checked before the location is outputted to the application.

    Priority of the IALocationRequest controls the mode of positioning and it emulates the Android's LocationRequest API as well. We can either request low power positions which enables efficient low-cost background usage of IndoorAtlas positioning, or we can request high accuracy updates when user needs very accurate locations.

    Priority of the positioning can be controlled runtime by requesting different priority positions in conjuction:

    A. Request low power positions by using setPriority(int) with PRIORITY_LOW_POWER. (see requesting location updates)

    B. Request high accuracy positions by using setPriority(int) with PRIORITY_HIGH_ACCURACY.

    C. Remove high accuracy positions in B (see removing location updates).

    In this scenario the application starts to receive low power positions after step A. After step B., the application starts to receive high accuracy positions seamlessly. Removing the high accuracy positions in C. leads to application receiving the low power positions again, seamlessly.

    Battery consumption can be efficiently controlled by using setPriority(int) with setFastestInterval(long). For example using an update interval of 15 seconds or more, leads to positioning consuming significantly less battery power.

    See Also:
    IALocationManager.requestLocationUpdates(IALocationRequest, IALocationListener), IALocationManager.removeLocationUpdates(IALocationListener)
    • Method Detail

      • getStringExtra

        public String getStringExtra​(String key)
      • setFastestInterval

        public IALocationRequest setFastestInterval​(long millis)
        Explicitly set the fastest interval for location updates, in milliseconds.

        This controls the fastest rate at which your application will receive location updates. The actual rate can be slower than requested but no faster than requested.

        There is now lower limit on the frequency but using a very small value may effect your application performance.

        If no value is set, the default value is 5Hz, i.e. 200ms

      • getFastestInterval

        public long getFastestInterval()
        Get fastest interval of this request, in milliseconds.
        SDK will never provide updates faster than getFastestInterval(). Actual frequency may be slower.
        Returns:
        fastest interval in milliseconds or -1 if value was not set
      • setSmallestDisplacement

        public IALocationRequest setSmallestDisplacement​(float meters)
        Set the minimum displacement between location updates in meters.

        This controls how often your application will receive location updates. User needs to move specified distance for the IALocationListener.onLocationChanged(IALocation) to trigger. First update will always be delivered as soon as one is available.

        Requesting updates faster has only minimal impact on battery consumption and will not cause extra network load.

      • getSmallestDisplacement

        public float getSmallestDisplacement()
        Get smallest displacement for location updates to trigger, in meters.
        Returns:
        minimum displacement between location updates in meters or -1 if not set.
      • setPriority

        public IALocationRequest setPriority​(int priority)
                                      throws IllegalArgumentException
        Set the priority of the location request.

        You can use this to set the priority of the request to either low power or high accuracy for the positioning.

        With the low power priority, one can expect positioning which has very low battery consumption. Low power positioning can be efficiently combined with fastest interval setting to control the power usage of positioning.

        High accuracy positioning provides best possible accuracy for active positioning tracking. High accuracy positioning has increased power consumption compared to low power positioning but the accuracy is also greatly improved.

        Throws:
        IllegalArgumentException - if priority is not PRIORITY_LOW_POWER, PRIORITY_HIGH_ACCURACY or PRIORITY_CART_MODE.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getParcelableExtra

        public <T extends Parcelable> T getParcelableExtra​(String key)