Class OutdoorLocationOptions
- java.lang.Object
-
- es.situm.sdk.location.OutdoorLocationOptions
-
- All Implemented Interfaces:
android.os.Parcelable
public class OutdoorLocationOptions extends java.lang.Object implements android.os.Parcelable
When you build theLocationRequest
, this data object configures the Global Mode (seeLocationRequest
for details) options: Outdoor positioning, Building Detector and Open Sky Detector parameters.Outdoor Positioning in Situm SDK is mainly provided using the GPS signals (and other location providers made available by Android). Configuring the Outdoor Positioning options lets you, in many ways, configure how Situm SDK reads and accesses to GPS signals. Relevant builder methods are:
enableOutdoorPositions
,computeInterval
,updateInterval
,minimumOutdoorLocationAccuracy
.Building Detector is a module that allows to configure how Situm SDK will detect the building where the user is (building detector strategy). Building detectors can set up by passing the
OutdoorLocationOptions.BuildingDetector
data object to theBuilder.buildingDetector
method. Other relevant builder methods arecenterPositionInBuildingDuringTransition
,scansBasedDetectorAlwaysOn
anduseGeofencesInBuildingSelector
.Open Sky Detector is a module that determines whether the user is "under roof" or "under open sky" based on the GPS signals received from each satellite. Specifically, it computes the SNR (Signal-Noise Ratio) of each satellite signal and determines that the user is "under roof" if the average SNR is below a (configurable) threshold, and "under open sky" otherwise. The rationale behind this is that in indoor spaces, building structures block GPS signals, therefore reducing the SNR value, while in outdoor spaces there is direct line of sight with the satellites, therefore increasing the SNR values. The typical SNR range of a satellite signal is in the [0, 40] dBm range, where:
- Typical indoor values are in the [0, 20] dBm range, where 0 dBm is the typical value under a thick roof, 10 dBm under a regular roof and 20 dBm under a glass roof.
- Typical outdoor values are in the [15, 40] dBm range, where 15 dBm is the typical when the user is outdoors but close or under elements that might block GPS signals (such as big buildings or trees), 25 the typical value under open sky. Values above 30 are rare * except for smartphone with a very good GPS chip.
These values should be taken as an approximate reference; they depend heavily on the smartphone quality and environment conditions. Relevant builder methods are:
enableOpenSkyDetector
andaverageSnrThreshold
This object will be passed to the
LocationRequest.Builder.outdoorLocationOptions
method when building theLocationRequest
. After that, you may start positioning as always by calling theLocationManager.requestLocationUpdates
.Requirements. ACCESS_FINE_LOCATION permission is required when using Situm SDK in Global Mode. See
LocationManager
for details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OutdoorLocationOptions.Builder
Builder for theOutdoorLocationOptions
class.static class
OutdoorLocationOptions.BuildingDetector
Allows to configure how Situm SDK will detect the building where the user is (building detector strategy).
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<OutdoorLocationOptions>
CREATOR
static float
DEFAULT_SNR
(Open Sky Detector only) Default GPS SNR (Signal-To-Noise Ratio) average value (in dBm) of methodOutdoorLocationOptions.Builder.averageSnrThreshold
.static float
MAX_SNR
(Open Sky Detector only) Default GPS SNR (Signal-To-Noise Ratio) average value (in dBm) that can be passed to methodOutdoorLocationOptions.Builder.averageSnrThreshold
.static float
MIN_SNR
(Open Sky Detector only) Minimum GPS SNR (Signal-To-Noise Ratio) average value (in dBm) that can be passed to methodOutdoorLocationOptions.Builder.averageSnrThreshold
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Boolean
centerPositionInBuildingDuringTransition()
Gets whetherOutdoorLocationOptions.Builder.centerPositionInBuildingDuringTransition(boolean)
has been set to true.int
describeContents()
java.lang.Boolean
enableOpenSkyDetector()
Deprecated.This feaure is not supported from Android 12 onward, and will be removed in future SDK versions.boolean
equals(java.lang.Object o)
java.lang.Float
getAverageSnrThreshold()
Deprecated.This feaure is not supported from Android 12 onward, and will be removed in future SDK versions.OutdoorLocationOptions.BuildingDetector
getBuildingDetector()
java.lang.Integer
getComputeInterval()
Gets the interval (in milliseconds) set inOutdoorLocationOptions.Builder.computeInterval(int)
.java.lang.Integer
getMinimumOutdoorLocationAccuracy()
Gets the minimum accuracy value set inOutdoorLocationOptions.Builder.minimumOutdoorLocationAccuracy(int)
.java.lang.Integer
getUpdateInterval()
Gets the interval (in milliseconds) set inOutdoorLocationOptions.Builder.updateInterval(int)
.int
hashCode()
java.lang.Boolean
isOutdoorPositionsEnabled()
Gets whetherOutdoorLocationOptions.Builder.enableOutdoorPositions(boolean)
has been set to true.java.lang.Boolean
isScansBasedDetectorAlwaysOn()
Gets whetherOutdoorLocationOptions.Builder.scansBasedDetectorAlwaysOn(boolean)
has been set to true.java.lang.Boolean
overrideSnrServervalue()
Deprecated.java.lang.String
toString()
java.lang.Boolean
useGeofencesInBuildingSelector()
Gets whetherOutdoorLocationOptions.Builder.useGeofencesInBuildingSelector(boolean)
has been set to true.void
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
MIN_SNR
public static final float MIN_SNR
(Open Sky Detector only) Minimum GPS SNR (Signal-To-Noise Ratio) average value (in dBm) that can be passed to methodOutdoorLocationOptions.Builder.averageSnrThreshold
. This value is 10.- See Also:
- Constant Field Values
-
MAX_SNR
public static final float MAX_SNR
(Open Sky Detector only) Default GPS SNR (Signal-To-Noise Ratio) average value (in dBm) that can be passed to methodOutdoorLocationOptions.Builder.averageSnrThreshold
. This value is 40.- See Also:
- Constant Field Values
-
DEFAULT_SNR
public static final float DEFAULT_SNR
(Open Sky Detector only) Default GPS SNR (Signal-To-Noise Ratio) average value (in dBm) of methodOutdoorLocationOptions.Builder.averageSnrThreshold
. This value is 28.- See Also:
- Constant Field Values
-
CREATOR
public static final android.os.Parcelable.Creator<OutdoorLocationOptions> CREATOR
-
-
Method Detail
-
getAverageSnrThreshold
@Deprecated public java.lang.Float getAverageSnrThreshold()
Deprecated.This feaure is not supported from Android 12 onward, and will be removed in future SDK versions.Gets the average SNR value set inOutdoorLocationOptions.Builder.averageSnrThreshold(float)
.- Returns:
- the average SNR value set in
OutdoorLocationOptions.Builder.averageSnrThreshold(float)
.
-
overrideSnrServervalue
public java.lang.Boolean overrideSnrServervalue()
Deprecated.
-
isScansBasedDetectorAlwaysOn
public java.lang.Boolean isScansBasedDetectorAlwaysOn()
Gets whetherOutdoorLocationOptions.Builder.scansBasedDetectorAlwaysOn(boolean)
has been set to true.- Returns:
- true if
OutdoorLocationOptions.Builder.scansBasedDetectorAlwaysOn(boolean)
has been set to true.
-
centerPositionInBuildingDuringTransition
public java.lang.Boolean centerPositionInBuildingDuringTransition()
Gets whetherOutdoorLocationOptions.Builder.centerPositionInBuildingDuringTransition(boolean)
has been set to true.- Returns:
- true if
OutdoorLocationOptions.Builder.centerPositionInBuildingDuringTransition(boolean)
has been set to true.
-
getMinimumOutdoorLocationAccuracy
public java.lang.Integer getMinimumOutdoorLocationAccuracy()
Gets the minimum accuracy value set inOutdoorLocationOptions.Builder.minimumOutdoorLocationAccuracy(int)
.- Returns:
- the minimum accuracy value set in
OutdoorLocationOptions.Builder.minimumOutdoorLocationAccuracy(int)
.
-
isOutdoorPositionsEnabled
public java.lang.Boolean isOutdoorPositionsEnabled()
Gets whetherOutdoorLocationOptions.Builder.enableOutdoorPositions(boolean)
has been set to true.- Returns:
- true if
OutdoorLocationOptions.Builder.enableOutdoorPositions(boolean)
has been set to true.
-
useGeofencesInBuildingSelector
public java.lang.Boolean useGeofencesInBuildingSelector()
Gets whetherOutdoorLocationOptions.Builder.useGeofencesInBuildingSelector(boolean)
has been set to true.- Returns:
- true if
OutdoorLocationOptions.Builder.useGeofencesInBuildingSelector(boolean)
has been set to true.
-
enableOpenSkyDetector
@Deprecated public java.lang.Boolean enableOpenSkyDetector()
Deprecated.This feaure is not supported from Android 12 onward, and will be removed in future SDK versions.Gets whetherOutdoorLocationOptions.Builder.enableOpenSkyDetector(boolean)
has been set to true.- Returns:
- true if
OutdoorLocationOptions.Builder.enableOpenSkyDetector(boolean)
has been set to true.
-
getBuildingDetector
public OutdoorLocationOptions.BuildingDetector getBuildingDetector()
Gets theOutdoorLocationOptions.BuildingDetector
set byOutdoorLocationOptions.Builder.buildingDetector(OutdoorLocationOptions.BuildingDetector)
.- Returns:
- the
OutdoorLocationOptions.BuildingDetector
instance.
-
getUpdateInterval
public java.lang.Integer getUpdateInterval()
Gets the interval (in milliseconds) set inOutdoorLocationOptions.Builder.updateInterval(int)
.- Returns:
- the interval (in milliseconds) set in
OutdoorLocationOptions.Builder.updateInterval(int)
.
-
getComputeInterval
public java.lang.Integer getComputeInterval()
Gets the interval (in milliseconds) set inOutdoorLocationOptions.Builder.computeInterval(int)
.- Returns:
- the interval (in milliseconds) set in
OutdoorLocationOptions.Builder.computeInterval(int)
.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
@NotNull public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-