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 to configure all theLocationRequestparameters.static enumDeprecated.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 enumAllows to indicate how the user that carries the smartphone moves: by foot (default), by car, etc.static enumEnum that allows to specify whether the geolocations computed should be sent to Situm Platform, and if so with which periodicity (time interval). -
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 millisecond by default)static final LocationRequest.MotionModeDefault motion mode (BY_FOOTby 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 system's tray.intbooleanReturn 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 .Return 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.Return the options used to customize the Foreground Service Notification, if any.Deprecated.Indoor provider isLocationRequest.IndoorProvider.INPHONEby default and can not be changed.Gets the minimum time interval (in milliseconds) allowed between consecutive Indoor Positions communicated viaLocationListener.onLocationChanged(Location)callback.Gets theLocationRequest.MotionMode, which specifies how the user moves (e.g.Gets theOutdoorLocationOptions, which specify parameters related to the Global Mode (e.g.Gets theLocationRequest.RealtimeUpdateInterval, which specifies the interval between consecutive geolocations uploaded to Situm Platform (or whether they should be uploaded at all).Gets the smallest smartphone displacement allowed between two consecutive Indoor Positions communicated viaLocationListener.onLocationChanged(Location)callback.inthashCode()Returns true if the 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 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 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 millisecond 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) -
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 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
Deprecated.Indoor provider isLocationRequest.IndoorProvider.INPHONEby default and can not 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 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
setUseBatterySaver(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 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
-
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.- Returns:
- Displacement in meters (float)
-
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.MotionModeobject
-
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
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
Notificationwith the methodLocationRequest.Builder.foregroundServiceNotification(Notification). App will run as a Foreground Service ifgetForegroundServiceNotification()is true.- Returns:
- An android.app.Notification object
-
getForegroundServiceNotificationOptions
Return 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 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
-
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.RealtimeUpdateIntervalobject
-
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
Return the configuredDiagnosticsOptions, which specifies options related to remote diagnostic and telemetry data.- Returns:
- DiagnosticsOptions
-
getAssetTrackingOptions
Return 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()
-