- java.lang.Object
-
- com.gluonhq.attach.position.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Parameters.Accuracy
Possible accuracy values.
-
Constructor Summary
Constructors Constructor Description Parameters(Parameters.Accuracy accuracy, boolean backgroundModeEnabled)
Set the accuracy value and the given time interval and distance filter specified for that value.Parameters(Parameters.Accuracy accuracy, long timeInterval, float distanceFilter, boolean backgroundModeEnabled)
Set the accuracy value, a time interval and distance filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Parameters.Accuracy
getAccuracy()
float
getDistanceFilter()
long
getTimeInterval()
boolean
isBackgroundModeEnabled()
java.lang.String
toString()
-
-
-
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 updatesbackgroundModeEnabled
- 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 updatestimeInterval
- 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
-
getAccuracy
public Parameters.Accuracy getAccuracy()
-
getTimeInterval
public long getTimeInterval()
-
getDistanceFilter
public float getDistanceFilter()
-
isBackgroundModeEnabled
public boolean isBackgroundModeEnabled()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-