Class LocationRequest
- java.lang.Object
-
- es.situm.sdk.location.LocationRequest
-
- All Implemented Interfaces:
android.os.Parcelable
public class LocationRequest extends java.lang.Object implements android.os.Parcelable
A data object that allows you to configure the positioning parameters of theLocationManager
(e.g. use WiFi or BLE, Building Mode vs Global Mode, etc.).To start positioning, this object will be passed to
LocationManager.requestLocationUpdates(LocationRequest, LocationListener)
. To build this object, you may use theLocationRequest.Builder
method (Builder Pattern).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LocationRequest.Builder
Builder constructor that allows to configure all theLocationRequest
parameters.static class
LocationRequest.IndoorProvider
Deprecated.This Enum is no longer used, the SDK always computes the geolocations in the same way (in the device without continuosly accessing the internet, behaving like the old INPHONE mode).static class
LocationRequest.MotionMode
Allows to indicate how the user that carries the smartphone moves: by foot (default), by car, etc.static class
LocationRequest.RealtimeUpdateInterval
Enum that allows to specify whether the geolocations computed should be sent to Situm Platform, and if so with which periodicity (time interval).
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<LocationRequest>
CREATOR
static LocationRequest.IndoorProvider
DEFAULT_INDOOR_PROVIDER
Default indoor provider (INPHONE
by default)static int
DEFAULT_INTERVAL
Default interval (in milliseconds) to notify location updates via theLocationListener.onLocationChanged()
callback (1000 millisecond by default)static LocationRequest.MotionMode
DEFAULT_MOTION_MODE
Default motion mode (BY_FOOT
by default)static LocationRequest.RealtimeUpdateInterval
DEFAULT_REALTIME_UPDATE_INTERVAL
Default interval (in milliseconds) between consecutive locations sent to Situm Platform (1000 milliseconds by default)static float
DEFAULT_SMALLEST_DISPLACEMENT
Default smallest displacement to notify location updates via theLocationListener.onLocationChanged()
callback (0.0 meters by default)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Boolean
autoEnableBleDuringPositioning()
Returns true if Situm SDK is configured to re-enable Bluetooth when the user disables it from system's tray.java.lang.Boolean
avoidDoze()
int
describeContents()
boolean
equals(java.lang.Object o)
java.util.List<BeaconFilter>
getBeaconFilters()
Gets the list of beacon UUIDs that will be taken into account when using BLE signals for positioning.java.lang.String
getBuildingIdentifier()
(Building Mode) Gets the identifier of the building where Situm SDK should perform positioning .DiagnosticsOptions
getDiagnosticsOptions()
Return the configuredDiagnosticsOptions
, which specifies options related to remote diagnostic and telemetry data.android.app.Notification
getForegroundServiceNotification()
Returns theNotification
that will be shown in the system's tray when the app is running as a Foreground Service.ForegroundServiceNotificationOptions
getForegroundServiceNotificationOptions()
Return the options used to customize the Foreground Service Notification, if any.LocationRequest.IndoorProvider
getIndoorProvider()
Deprecated.Indoor provider isLocationRequest.IndoorProvider.INPHONE
by default and can not be changed.java.lang.Integer
getInterval()
Gets the minimum time interval (in milliseconds) allowed between consecutive Indoor Positions communicated viaLocationListener.onLocationChanged(Location)
callback.LocationRequest.MotionMode
getMotionMode()
Gets theLocationRequest.MotionMode
, which specifies how the user moves (e.g.OutdoorLocationOptions
getOutdoorLocationOptions()
Gets theOutdoorLocationOptions
, which specify parameters related to the Global Mode (e.g.LocationRequest.RealtimeUpdateInterval
getRealtimeUpdateInterval()
Gets theLocationRequest.RealtimeUpdateInterval
, which specifies the interval between consecutive geolocations uploaded to Situm Platform (or whether they should be uploaded at all).RouteAdjustment
getRouteAdjustment()
java.lang.Integer
getRouteId()
java.util.List<Point>
getRoutePoints()
java.lang.Float
getSmallestDisplacement()
Gets the smallest smartphone displacement allowed between two consecutive Indoor Positions communicated viaLocationListener.onLocationChanged(Location)
callback.int
hashCode()
java.lang.Boolean
isIgnoreWifiThrottling()
Returns true if the WiFi Throttling protections should be ignored (or, in other words, if WiFi should be scanned as fast as possible).java.lang.Boolean
isLocationDelimitedByRoute()
java.lang.Boolean
isPreloadInfo()
java.lang.String
toString()
java.lang.Boolean
useBarometer()
Returns true if the barometer should be used to compute Indoor Positioning (helps with floor changes).java.lang.Boolean
useBatterySaver()
Returns true if Battery Saver mode is ON (stops geolocation computations after prolonged smartphone inactivity).java.lang.Boolean
useBle()
Returns true if BLE scanning is enabled to compute Indoor Positioning.java.lang.Boolean
useCompass()
Returns true if compass is enabled to compute Indoor Positioning.java.lang.Boolean
useDeadReckoning()
Returns true Dead Reckoning should be used to compute fast orientation updates (several per second) to account for quick orientation changes (recommended to provide a smooth wayfinding experience).java.lang.Boolean
useForegroundService()
Returns true if Situm SDK should run infinitely even if the app goes to the background.java.lang.Boolean
useGlobalLocation()
Return true if Global Mode is enabled (positioning anywhere with automatic building detection).java.lang.Boolean
useGps()
Returns true if GPS geolocation is enabled to compute Indoor Positioning.java.lang.Boolean
useGyro()
Returns true if gyroscope is enabled to compute Indoor Positioning.java.lang.Boolean
useLocationsCache()
java.lang.Boolean
useWifi()
Returns true if WiFi scanning is enabled to compute Indoor Positioning.void
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
DEFAULT_INTERVAL
public static final int DEFAULT_INTERVAL
Default interval (in milliseconds) to notify location updates via theLocationListener.onLocationChanged()
callback (1000 millisecond by default)- See Also:
- Constant Field Values
-
DEFAULT_INDOOR_PROVIDER
public static final LocationRequest.IndoorProvider DEFAULT_INDOOR_PROVIDER
Default indoor provider (INPHONE
by default)
-
DEFAULT_MOTION_MODE
public static final LocationRequest.MotionMode DEFAULT_MOTION_MODE
Default motion mode (BY_FOOT
by default)
-
DEFAULT_SMALLEST_DISPLACEMENT
public static final float DEFAULT_SMALLEST_DISPLACEMENT
Default smallest displacement to notify location updates via theLocationListener.onLocationChanged()
callback (0.0 meters by default)- See Also:
- Constant Field Values
-
DEFAULT_REALTIME_UPDATE_INTERVAL
public static final LocationRequest.RealtimeUpdateInterval DEFAULT_REALTIME_UPDATE_INTERVAL
Default interval (in milliseconds) between consecutive locations sent to Situm Platform (1000 milliseconds by default)
-
CREATOR
public static final android.os.Parcelable.Creator<LocationRequest> CREATOR
-
-
Method Detail
-
isLocationDelimitedByRoute
public java.lang.Boolean isLocationDelimitedByRoute()
-
getRouteId
public java.lang.Integer getRouteId()
-
getRoutePoints
public java.util.List<Point> getRoutePoints()
-
getBuildingIdentifier
public java.lang.String getBuildingIdentifier()
(Building Mode) Gets the identifier of the building where Situm SDK should perform positioning .To set this value, use method
LocationRequest.Builder.buildingIdentifier(String)
.- Returns:
- String with building identifier
-
getInterval
public java.lang.Integer getInterval()
Gets the minimum time interval (in milliseconds) allowed between consecutive Indoor Positions communicated viaLocationListener.onLocationChanged(Location)
callback.To set this value, use
LocationRequest.Builder.interval(int)
.- Returns:
- interval value in milliseconds
-
getIndoorProvider
@NonNull public LocationRequest.IndoorProvider getIndoorProvider()
Deprecated.Indoor provider isLocationRequest.IndoorProvider.INPHONE
by default and can not be changed.- Returns:
- An
LocationRequest.IndoorProvider
object
-
useBle
public java.lang.Boolean useBle()
Returns true if BLE scanning is enabled to compute Indoor Positioning.To set this value, use
LocationRequest.Builder.useBle(boolean)
.- Returns:
- Boolean.
-
useWifi
public java.lang.Boolean useWifi()
Returns true if WiFi scanning is enabled to compute Indoor Positioning.To set this value, use
LocationRequest.Builder.useWifi(boolean)
.- Returns:
- Boolean.
-
useCompass
public java.lang.Boolean useCompass()
Returns true if compass is enabled to compute Indoor Positioning.To set this value, use
LocationRequest.Builder.useCompass(boolean)
.- Returns:
- Boolean.
-
useGps
public java.lang.Boolean useGps()
Returns true if GPS geolocation is enabled to compute Indoor Positioning.To set this value, use
LocationRequest.Builder.useGps(boolean)
.- Returns:
- Boolean.
-
useGyro
public java.lang.Boolean useGyro()
Returns true if gyroscope is enabled to compute Indoor Positioning.To set this value, use
LocationRequest.Builder.useGyro(boolean)
.- Returns:
- Boolean.
-
useBatterySaver
public java.lang.Boolean useBatterySaver()
Returns true if Battery Saver mode is ON (stops geolocation computations after prolonged smartphone inactivity).To set this value, use
setUseBatterySaver(Boolean)
.- Returns:
- Boolean.
-
useBarometer
public java.lang.Boolean useBarometer()
Returns true if the barometer should be used to compute Indoor Positioning (helps with floor changes).To set this value, use
LocationRequest.Builder.useBarometer(boolean)
.- Returns:
- Boolean.
-
isIgnoreWifiThrottling
public java.lang.Boolean isIgnoreWifiThrottling()
Returns true if the WiFi Throttling protections should be ignored (or, in other words, if WiFi should be scanned as fast as possible).To set this value, use
LocationRequest.Builder.ignoreWifiThrottling(boolean)
.- Returns:
- Boolean.
-
isPreloadInfo
public java.lang.Boolean isPreloadInfo()
-
useLocationsCache
public java.lang.Boolean useLocationsCache()
-
getSmallestDisplacement
public java.lang.Float getSmallestDisplacement()
Gets the smallest smartphone displacement allowed between two consecutive Indoor Positions communicated viaLocationListener.onLocationChanged(Location)
callback.To set this value, use
LocationRequest.Builder.smallestDisplacement
.- Returns:
- Displacement in meters (float)
-
getMotionMode
public LocationRequest.MotionMode getMotionMode()
Gets theLocationRequest.MotionMode
, which specifies how the user moves (e.g. by walk) and adapts the positioning algorithm accordingly.To set this value, use
LocationRequest.Builder.motionMode(MotionMode)
. Default value isDEFAULT_MOTION_MODE
.- Returns:
LocationRequest.MotionMode
object
-
useDeadReckoning
public java.lang.Boolean useDeadReckoning()
Returns true Dead Reckoning should be used to compute fast orientation updates (several per second) to account for quick orientation changes (recommended to provide a smooth wayfinding experience).To set this value, use
LocationRequest.Builder.useDeadReckoning(boolean)
.- Returns:
- Boolean.
-
useForegroundService
public java.lang.Boolean useForegroundService()
Returns true if Situm SDK should run infinitely even if the app goes to the background.To set this value, use
LocationRequest.Builder.useForegroundService(boolean)
.- Returns:
- Boolean
-
getForegroundServiceNotification
@Nullable public android.app.Notification getForegroundServiceNotification()
Returns theNotification
that will be shown in the system's tray when the app is running as a Foreground Service.You may set this
Notification
with the methodLocationRequest.Builder.foregroundServiceNotification(Notification)
. App will run as a Foreground Service ifgetForegroundServiceNotification()
is true.- Returns:
- An android.app.Notification object
-
getForegroundServiceNotificationOptions
@Nullable public ForegroundServiceNotificationOptions getForegroundServiceNotificationOptions()
Return the options used to customize the Foreground Service Notification, if any.- Returns:
- ForegroundServiceNotificationOptions
-
getOutdoorLocationOptions
@NonNull public OutdoorLocationOptions getOutdoorLocationOptions()
Gets theOutdoorLocationOptions
, which specify parameters related to the Global Mode (e.g. building detector to be used, outdoor positioning frequency configuration, etc.)To set this value, use
LocationRequest.Builder.outdoorLocationOptions(OutdoorLocationOptions)
.- Returns:
OutdoorLocationOptions
object
-
getRouteAdjustment
@Nullable public RouteAdjustment getRouteAdjustment()
-
useGlobalLocation
public java.lang.Boolean useGlobalLocation()
Return true if Global Mode is enabled (positioning anywhere with automatic building detection). Global Mode will be enabled if no building identifier has been set using the methodLocationRequest.Builder.buildingIdentifier(String)
.
-
getBeaconFilters
public java.util.List<BeaconFilter> getBeaconFilters()
Gets the list of beacon UUIDs that will be taken into account when using BLE signals for positioning.By default, this list will be empty, although beacons with the standard Situm UUID ("73697475-6D73-6974-756D-736974756D15") will always be used for BLE based positioning.
If you wish to use other beacons with different UUIDs, you may configure them by using the
LocationRequest.Builder.addBeaconFilters(List)
orLocationRequest.Builder.addBeaconFilter(BeaconFilter)
methods.- Returns:
- list of beacon UUIDs
-
avoidDoze
public java.lang.Boolean avoidDoze()
-
getRealtimeUpdateInterval
public LocationRequest.RealtimeUpdateInterval getRealtimeUpdateInterval()
Gets theLocationRequest.RealtimeUpdateInterval
, which specifies the interval between consecutive geolocations uploaded to Situm Platform (or whether they should be uploaded at all).To set this value, use
LocationRequest.Builder.realtimeUpdateInterval(RealtimeUpdateInterval)
.- Returns:
LocationRequest.RealtimeUpdateInterval
object
-
autoEnableBleDuringPositioning
public java.lang.Boolean autoEnableBleDuringPositioning()
Returns true if Situm SDK is configured to re-enable Bluetooth when the user disables it from system's tray.To set this value, use
LocationRequest.Builder.autoEnableBleDuringPositioning(Boolean)
.- Returns:
- Boolean
-
getDiagnosticsOptions
public DiagnosticsOptions getDiagnosticsOptions()
Return the configuredDiagnosticsOptions
, which specifies options related to remote diagnostic and telemetry data.- Returns:
- DiagnosticsOptions
-
toString
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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-