Class Parameters


  • public class Parameters
    extends java.lang.Object
    The Position Service can be configured with several parameters. These include desired accuracy, from lowest to highest. This may have a high impact in the user's battery, so it is developer's responsibility to use the less accuracy as possible. Distance filter and timeInterval are the minimum values to get notification in location changes. Background mode will allow the service to operate even when the app is not in foreground.
    Since:
    3.8.0
    • Constructor Detail

      • Parameters

        public Parameters​(Parameters.Accuracy accuracy,
                          boolean backgroundModeEnabled)
        Set the accuracy value and the given time interval and distance filter specified for that value.
        Parameters:
        accuracy - Desired accuracy in location updates
        backgroundModeEnabled - allows position updates when the app is running in background
      • Parameters

        public Parameters​(Parameters.Accuracy accuracy,
                          long timeInterval,
                          float distanceFilter,
                          boolean backgroundModeEnabled)
        Set the accuracy value, a time interval and distance filter.
        Parameters:
        accuracy - Desired accuracy in location updates
        timeInterval - minimum number of milliseconds between location updates.
        distanceFilter - minimum number of meters between location updates.
        backgroundModeEnabled - allows position updates when the app is running in background
    • Method Detail

      • getTimeInterval

        public long getTimeInterval()
      • getDistanceFilter

        public float getDistanceFilter()
      • isBackgroundModeEnabled

        public boolean isBackgroundModeEnabled()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object