Class LocationRequest
- All Implemented Interfaces:
android.os.Parcelable
LocationManager (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 the LocationRequest.Builder method (Builder Pattern).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder constructor that allows you to configure allLocationRequestparameters.static enumDeprecated.This enum is no longer used.static enumIndicates how the user carrying the smartphone moves: on foot (default), by car, etc.static enumDetermines how often the SDK attempts to upload buffered location updates to Situm Platform. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final android.os.Parcelable.Creator<LocationRequest>static final LocationRequest.IndoorProviderDefault indoor provider (INPHONEby default)static final intDefault interval (in milliseconds) to notify location updates via theLocationListener.onLocationChanged()callback (1000 milliseconds by default)static final LocationRequest.MotionModeDefault motion mode (BY_FOOTby default)static final intDefault interval in milliseconds used to limit locations stored locally for upload (1000 milliseconds by default).static final LocationRequest.RealtimeUpdateIntervalDefault interval (in milliseconds) between consecutive locations sent to Situm Platform (1000 milliseconds by default)static final floatDefault smallest displacement to notify location updates via theLocationListener.onLocationChanged()callback (0.0 meters by default)Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Method Summary
Modifier and TypeMethodDescriptionReturns true if Situm SDK is configured to re-enable Bluetooth when the user disables it from the system tray.intbooleanReturns the configuredAssetTrackingOptions, which specifies options related to asset tracking using BLE beacons.Gets the list of beacon UUIDs that will be taken into account when using BLE signals for positioning.(Building Mode) Gets the identifier of the building where Situm SDK should perform positioning.Returns the configuredDiagnosticsOptions, which specifies options related to remote diagnostic and telemetry data.android.app.NotificationReturns theNotificationthat will be shown in the system's tray when the app is running as a Foreground Service.Returns the options used to customize the Foreground Service Notification, if any.Deprecated.Indoor provider isLocationRequest.IndoorProvider.INPHONEby default and cannot be changed.Gets the minimum interval in milliseconds between Indoor Positions delivered throughLocationListener.onLocationChanged(Location).Gets theLocationRequest.MotionMode, which specifies how the user moves (e.g.Gets theOutdoorLocationOptions, which specify parameters related to the Global Mode (e.g.Gets the interval used to limit locations stored locally for upload to Situm Platform.Gets the configuredLocationRequest.RealtimeUpdateInterval, which specifies the upload interval for buffered locations.Gets the smallest smartphone displacement allowed between two consecutive Indoor Positions communicated viaLocationListener.onLocationChanged(Location)callback.inthashCode()Returns true if WiFi Throttling protections should be ignored (or, in other words, if WiFi should be scanned as fast as possible).toString()Returns true if the barometer should be used to compute Indoor Positioning (helps with floor changes).Returns true if Battery Saver mode is ON (stops geolocation computations after prolonged smartphone inactivity).useBle()Returns true if BLE scanning is enabled to compute Indoor Positioning.Returns true if compass is enabled to compute Indoor Positioning.Returns true if 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).Returns true if Situm SDK should run infinitely even if the app goes to the background.Return true if Global Mode is enabled (positioning anywhere with automatic building detection).useGps()Returns true if GPS geolocation is enabled to compute Indoor Positioning.useGyro()Returns true if the gyroscope is enabled to compute Indoor Positioning.useWifi()Returns true if WiFi scanning is enabled to compute Indoor Positioning.voidwriteToParcel(android.os.Parcel dest, int flags)
-
Field Details
-
DEFAULT_INTERVAL
public static final int DEFAULT_INTERVALDefault interval (in milliseconds) to notify location updates via theLocationListener.onLocationChanged()callback (1000 milliseconds by default)- See Also:
-
DEFAULT_INDOOR_PROVIDER
Default indoor provider (INPHONEby default) -
DEFAULT_MOTION_MODE
Default motion mode (BY_FOOTby default) -
DEFAULT_SMALLEST_DISPLACEMENT
public static final float DEFAULT_SMALLEST_DISPLACEMENTDefault smallest displacement to notify location updates via theLocationListener.onLocationChanged()callback (0.0 meters by default)- See Also:
-
DEFAULT_REALTIME_UPDATE_INTERVAL
Default interval (in milliseconds) between consecutive locations sent to Situm Platform (1000 milliseconds by default) -
DEFAULT_REALTIME_PERSISTENCE_INTERVAL
public static final int DEFAULT_REALTIME_PERSISTENCE_INTERVALDefault interval in milliseconds used to limit locations stored locally for upload (1000 milliseconds by default).- See Also:
-
CREATOR
-
-
Method Details
-
isLocationDelimitedByRoute
-
getRouteId
-
getRoutePoints
-
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
Gets the minimum interval in milliseconds between Indoor Positions delivered throughLocationListener.onLocationChanged(Location).Use
LocationRequest.Builder.interval(int)to configure this value. The default isDEFAULT_INTERVALmilliseconds.- Returns:
- interval value in milliseconds
-
getIndoorProvider
Deprecated.Indoor provider isLocationRequest.IndoorProvider.INPHONEby default and cannot be changed.- Returns:
- An
LocationRequest.IndoorProviderobject
-
useBle
Returns true if BLE scanning is enabled to compute Indoor Positioning.To set this value, use
LocationRequest.Builder.useBle(boolean).- Returns:
- 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
Returns true if compass is enabled to compute Indoor Positioning.To set this value, use
LocationRequest.Builder.useCompass(boolean).- Returns:
- 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
Returns true if the gyroscope is enabled to compute Indoor Positioning.To set this value, use
LocationRequest.Builder.useGyro(boolean).- Returns:
- Boolean.
-
useBatterySaver
Returns true if Battery Saver mode is ON (stops geolocation computations after prolonged smartphone inactivity).To set this value, use
LocationRequest.Builder.useBatterySaver(Boolean).- Returns:
- 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
Returns true if 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
-
useLocationsCache
-
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(float).- Returns:
- Displacement in meters (float)
-
getMotionMode
Gets theLocationRequest.MotionMode, which specifies how the user moves (e.g. on foot) and adapts the positioning algorithm accordingly.To set this value, use
LocationRequest.Builder.motionMode(MotionMode). Default value isDEFAULT_MOTION_MODE.- Returns:
LocationRequest.MotionModeobject
-
useDeadReckoning
Returns true if 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
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 theNotificationthat will be shown in the system's tray when the app is running as a Foreground Service.You may set this
NotificationwithLocationRequest.Builder.foregroundServiceNotification(Notification). The app runs as a Foreground Service ifuseForegroundService()is true.- Returns:
- An android.app.Notification object
-
getForegroundServiceNotificationOptions
Returns the options used to customize the Foreground Service Notification, if any.- Returns:
- ForegroundServiceNotificationOptions
-
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:
OutdoorLocationOptionsobject
-
getRouteAdjustment
-
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
Gets the list of beacon UUIDs that will be taken into account when using BLE signals for positioning.By default, this list is 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 beacons with other UUIDs, configure them with
LocationRequest.Builder.addBeaconFilters(List)orLocationRequest.Builder.addBeaconFilter(BeaconFilter).- Returns:
- list of beacon filters
-
avoidDoze
-
getRealtimeUpdateInterval
Gets the configuredLocationRequest.RealtimeUpdateInterval, which specifies the upload interval for buffered locations.To set this value, use
LocationRequest.Builder.realtimeUpdateInterval(RealtimeUpdateInterval).- Returns:
LocationRequest.RealtimeUpdateIntervalobject
-
getRealtimePersistenceInterval
Gets the interval used to limit locations stored locally for upload to Situm Platform.This value does not change location computation, application callback cadence, or upload batching. It limits how frequently Indoor and Outdoor Locations can be stored locally for later upload.
- Returns:
- interval in milliseconds, or
nullwhen it has not been set locally
-
autoEnableBleDuringPositioning
Returns true if Situm SDK is configured to re-enable Bluetooth when the user disables it from the system tray.To set this value, use
LocationRequest.Builder.autoEnableBleDuringPositioning(Boolean).- Returns:
- Boolean
-
getDiagnosticsOptions
Returns the configuredDiagnosticsOptions, which specifies options related to remote diagnostic and telemetry data.- Returns:
- DiagnosticsOptions
-
getAssetTrackingOptions
Returns the configuredAssetTrackingOptions, which specifies options related to asset tracking using BLE beacons.- Returns:
- AssetTrackingOptions
-
toString
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
equals
-
hashCode
public int hashCode()
-