Enum LocationStatus
- java.lang.Object
-
- java.lang.Enum<LocationStatus>
-
- es.situm.sdk.location.LocationStatus
-
- All Implemented Interfaces:
MapperInterface
,java.io.Serializable
,java.lang.Comparable<LocationStatus>
public enum LocationStatus extends java.lang.Enum<LocationStatus> implements MapperInterface
Location status values passed via theLocationListener.onStatusChanged(LocationStatus)
callback. Status values inform the app of:- Actions or steps performed by the
LocationManager
. - Warning situations that may (or not) cause an error if they are not dealt with.
- General Info that may be of interest.
In some way, "Action" status values can be thought as states, because the
LocationManager
always executes the same series of actions. This sequence is different if theLocationRequest
has been configured in Building Mode or Global Mode.- Building Mode. The sequence of actions is always:
STARTING
,PREPARING_POSITIONING_MODEL
,START_DOWNLOADING_POSITIONING_MODEL
,PROCESSING_POSITIONING_MODEL
,STARTING_POSITIONING
,CALCULATING
. If a valid location can not be computed in the building, Situm SDK will keep trying but an statusUSER_NOT_IN_BUILDING
is returned. The actionSTART_DOWNLOADING_POSITIONING_MODEL
is not executed if the Positioning Model of the building has been downloaded before and still exists in the Situm SDK Cache. If positioning stops, the statusSTOPPED
is returned. - Global Mode. The sequence of actions is always:
STARTING
,CALCULATING
. Versions prior to 2.85.0 will reverse the order of the mentioned states.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALARM_PERMISSIONS_NEEDED_TO_AVOID_DOZE
To use the avoidDoze functionality you need to declare USE_EXACT_ALARM and SCHEDULE_EXACT_ALARM permissions on your AndroidManifestAUTO_ENABLE_BLE_FORBIDDEN
Device incompatible withLocationRequest.Builder.autoEnableBleDuringPositioning(Boolean)
.BLE_NOT_AVAILABLE
Bluetooth sensor is not available or the app is running on Android SDK API < 18 (BLE scanning is not supported before API 18).BLE_SENSOR_DISABLED_BY_USER
The BLE sensor has been disabled by the user (e.g.CALCULATING
Situm SDK is computing the location of the user.COMPASS_CALIBRATION_NEEDED
Warning: the compass is uncalibrated and needs to be calibrated.COMPASS_CALIBRATION_NOT_NEEDED
General Info: the compass is properly calibrated and its data will be used without any issue.GEOFENCES_NOT_AVAILABLE
The download of the building's geofences has failed andGeofenceListener
won't work.GLOBAL_LOCATION_NOT_FOUND
(Global Mode only) Warning: Google Location provider (for example, GPS) has not been able to return locations in the first 30 seconds (Situm SDK will keep trying).LOCATION_DISABLED
(Building Mode only) Warning: the user has disabled the smartphone's location (e.g.NO_CONNECTION
Deprecated.Warning: no internet connection is available (Situm SDK will not be able to download Positioning Models).PREPARING_POSITIONING_MODEL
(Building Mode only) Situm SDK is getting ready to download the Positioning Model.PROCESSING_POSITIONING_MODEL
(Building Mode only) The Positioning Model has been downloaded and now is being processed in order to start Indoor Positioning in its building.RETRY_DOWNLOAD_POSITIONING_MODEL
(Building Mode only) The download of the Positioning Model has failed and Situm SDK will retry again.START_DOWNLOADING_POSITIONING_MODEL
(Building Mode only) The download of the Positioning Model is starting.STARTING
This is the first action performed by theLocationManager
: it just means that it is starting.STARTING_POSITIONING
(Building Mode only) Indoor Positioning is starting: Situm SDK will start reading sensor data (for example, WIFI and BLE) and computing the Indoor Position within the selected building.STOPPED
TheLocationManager
has stopped (this may happen because of an error or after callingLocationManager.removeUpdates(LocationListener)
).TIME_SETTINGS_MANUAL
Warning: The user has disabled the "Automatic date and time" setting of the smartphone, therefore the date and time will be manually determined by the user, instead of automatically determined by the network.USER_NOT_IN_BUILDING
(Building Mode only) A valid position can not be computed in the selected building.WIFI_SCAN_THROTTLED
(Android 9 and superior only) The WiFi scan is throttled (see this article for details), and the WiFi scan interval will be changed to one scan every 30 seconds.
-
Field Summary
-
Fields inherited from interface es.situm.sdk.model.MapperInterface
ACCESSIBILITY_MODE, ACCURACY, ADDRESS, ALTITUDE, BEARING, BEARING_FROM, BEARING_QUALITY, BOUNDS, BOUNDS_ROTATED, BUILDING, BUILDING_IDENTIFIER, BUILDING_NAME, CARTESIAN_BEARING, CARTESIAN_COORDINATE, CENTER, CLOSEST_LOCATION_IN_ROUTE, CODE, CONVERSION, COORDINATE, CREATED_AT, CURRENT_INDICATION, CURRENT_STEP_INDEX, CUSTOM_FIELDS, dateFormat, DEGREES, DEGREES_CLOCKWISE, DEVICE_ID, DIMENSIONS, DISTANCE, DISTANCE_TO_CHANGE_FLOOR_THRESHOLD, DISTANCE_TO_CHANGE_INDICATION_THRESHOLD, DISTANCE_TO_CLOSEST_POINT_IN_ROUTE, DISTANCE_TO_END_STEP, DISTANCE_TO_GOAL, DISTANCE_TO_GOAL_THRESHOLD, DISTANCE_TO_IGNORE_FIRST_INDICATION, DISTANCE_TO_NEXT_LEVEL, EDGES, EVENTS, EXCLUDED_TAGS, EXTERNAL_NAVIGATION_PAYLOAD, EXTERNAL_NAVIGATION_TYPE, FIRST_STEP, FLOOR, FLOOR_IDENTIFIER, FLOORS, FOREGROUND_SERVICE_NOTIFICATION_MESSAGE, FOREGROUND_SERVICE_NOTIFICATION_SHOW_STOP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_STOP_ACTION_TEXT, FOREGROUND_SERVICE_NOTIFICATION_TAP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_TITLE, FROM, GEOFENCES, HAS_BEARING, HAS_CARTESIAN_BEARING, HEIGHT, HUMAN_READABLE_MESSAGE, ID, IDENTIFIER, IGNORE_LOW_QUALITY_LOCATIONS, INCLUDED_TAGS, INDICATION_TYPE, INDICATIONS, INDICATIONS_INTERVAL, INDOOR_POIS, INFO_HTML, IS_FIRST, IS_INDOOR, IS_LAST, IS_OUTDOOR, IS_PUBLIC, LAST_STEP, LATITUDE, LONGITUDE, MAP_URL, MINIMIZE_FLOOR_CHANGES, NAME, NEEDED_LEVEL_CHANGE, NEXT_INDICATION, NEXT_LEVEL, NODES, NORTH_EAST, NORTH_WEST, ORIENTATION, ORIENTATION_TYPE, OUTDOOR_BUILDING_DETECTOR_BLE, OUTDOOR_POIS, OUTSIDE_ROUTE_THRESHOLD, PICTURE_THUMB_URL, PICTURE_URL, POI_CATEGORIES, POI_CATEGORY, POI_CATEGORY_CODE, POI_CATEGORY_ICON_SELECTED, POI_CATEGORY_ICON_UNSELECTED, POI_CATEGORY_IDENTIFIER, POI_CATEGORY_IDENTIFIERS, POI_CATEGORY_iNAME, POI_CATEGORY_NAME, POI_NAME, POI_TO, POI_TO_IDENTIFIER, POINTS, POLYGON_POINTS, POSITION, PROVIDER, QUALITY, RADIANS, RADIANS_MINUS_PI_PI, RADIUS, ROTATION, ROUND_INDICATIONS_STEP, ROUTE, ROUTE_STEP, SCALE, SEGMENTS, SOUTH_EAST, SOUTH_WEST, STATUS_NAME, STATUS_ORDINAL, STEP_IDX_DESTINATION, STEP_IDX_ORIGIN, STEPS, TIME_TO_END_STEP, TIME_TO_FIRST_INDICATION, TIME_TO_GOAL, TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGES, TIMESTAMP, TO, TO_LEGACY, TRIGGER, UPDATED_AT, USER_IDENTIFIER, WIDTH, X, Y
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
toMap()
Method to transform object into Mapstatic LocationStatus
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static LocationStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STARTING
public static final LocationStatus STARTING
This is the first action performed by theLocationManager
: it just means that it is starting.In Building Mode, this is the first action performed. It indicates that the Situm SDK is starting all the processes required to perform Indoor Positioning in that building.
Beta!!. In Global Mode this is the last action returned but it should be the first. As in Building Mode, it indicates that the SDK is starting all the processes required to perform Global Positioning.
-
PREPARING_POSITIONING_MODEL
public static final LocationStatus PREPARING_POSITIONING_MODEL
(Building Mode only) Situm SDK is getting ready to download the Positioning Model.
-
START_DOWNLOADING_POSITIONING_MODEL
public static final LocationStatus START_DOWNLOADING_POSITIONING_MODEL
(Building Mode only) The download of the Positioning Model is starting.
-
RETRY_DOWNLOAD_POSITIONING_MODEL
public static final LocationStatus RETRY_DOWNLOAD_POSITIONING_MODEL
(Building Mode only) The download of the Positioning Model has failed and Situm SDK will retry again.
-
PROCESSING_POSITIONING_MODEL
public static final LocationStatus PROCESSING_POSITIONING_MODEL
(Building Mode only) The Positioning Model has been downloaded and now is being processed in order to start Indoor Positioning in its building.
-
STARTING_POSITIONING
public static final LocationStatus STARTING_POSITIONING
(Building Mode only) Indoor Positioning is starting: Situm SDK will start reading sensor data (for example, WIFI and BLE) and computing the Indoor Position within the selected building.
-
USER_NOT_IN_BUILDING
public static final LocationStatus USER_NOT_IN_BUILDING
(Building Mode only) A valid position can not be computed in the selected building.This happens because WiFi and/or BLE signals received by the smartphone do not match with those present in the building's Positioning Model (gathered during the building calibration). Usually, this means that the user is not in the building (e.g. she has gone far away from it).
-
CALCULATING
public static final LocationStatus CALCULATING
Situm SDK is computing the location of the user.In Building Mode, this is the last action performed. The SDK has all the information it needs and Indoor Positioning has started at this point. This action will be repeated until a valid location can be computed in the building. Otherwise, a status
USER_NOT_IN_BUILDING
will be returned.Beta!! In Global Mode, the Situm SDK starts to compute Global Positioning: tries to determine whether the user is in any known building to start Indoor Positioning in it, otherwise computes Outdoor Positioning. In versions prior to 2.85.0 this is the first action returned (now fixed).
-
NO_CONNECTION
public static final LocationStatus NO_CONNECTION
Deprecated.Warning: no internet connection is available (Situm SDK will not be able to download Positioning Models).
-
COMPASS_CALIBRATION_NEEDED
public static final LocationStatus COMPASS_CALIBRATION_NEEDED
Warning: the compass is uncalibrated and needs to be calibrated.See this article for details on how to calibrate it.
-
COMPASS_CALIBRATION_NOT_NEEDED
public static final LocationStatus COMPASS_CALIBRATION_NOT_NEEDED
General Info: the compass is properly calibrated and its data will be used without any issue.
-
BLE_NOT_AVAILABLE
public static final LocationStatus BLE_NOT_AVAILABLE
Bluetooth sensor is not available or the app is running on Android SDK API < 18 (BLE scanning is not supported before API 18).
-
GEOFENCES_NOT_AVAILABLE
public static final LocationStatus GEOFENCES_NOT_AVAILABLE
The download of the building's geofences has failed andGeofenceListener
won't work.
-
AUTO_ENABLE_BLE_FORBIDDEN
public static final LocationStatus AUTO_ENABLE_BLE_FORBIDDEN
Device incompatible withLocationRequest.Builder.autoEnableBleDuringPositioning(Boolean)
. Bluetooth cannot be enabled automatically on Android >= 13 or Huawei devices. In case you want the user to enable the Bluetooth to scan beacons, refer to the documentation of the already mentioned method.
-
ALARM_PERMISSIONS_NEEDED_TO_AVOID_DOZE
public static final LocationStatus ALARM_PERMISSIONS_NEEDED_TO_AVOID_DOZE
To use the avoidDoze functionality you need to declare USE_EXACT_ALARM and SCHEDULE_EXACT_ALARM permissions on your AndroidManifest
-
TIME_SETTINGS_MANUAL
public static final LocationStatus TIME_SETTINGS_MANUAL
Warning: The user has disabled the "Automatic date and time" setting of the smartphone, therefore the date and time will be manually determined by the user, instead of automatically determined by the network.Since Situm SDK tags each geolocation with the timestamp returned by the smartphone, this will cause that geolocations will be tagged as if they were generated in the past or in the future. Obviously, this is not recommended: Situm Platform requires that all devices are synchronized to the same network clock in order to work properly.
-
GLOBAL_LOCATION_NOT_FOUND
public static final LocationStatus GLOBAL_LOCATION_NOT_FOUND
(Global Mode only) Warning: Google Location provider (for example, GPS) has not been able to return locations in the first 30 seconds (Situm SDK will keep trying).
-
BLE_SENSOR_DISABLED_BY_USER
public static final LocationStatus BLE_SENSOR_DISABLED_BY_USER
The BLE sensor has been disabled by the user (e.g. in the system's tray). BLE scanning will be disabled ifLocationRequest.useBle()
is true andLocationRequest.autoEnableBleDuringPositioning()
is false.
-
LOCATION_DISABLED
public static final LocationStatus LOCATION_DISABLED
(Building Mode only) Warning: the user has disabled the smartphone's location (e.g. in the system's tray), therefore Situm SDK may not be able to compute user's geolocation.Disabling the smartphone's location will prevent Situm SDK to scan Wi-Fi and BLE in most devices. Therefore, Situm SDK will not be able to work properly in this case. You should urge the user to enable the smartphone's location again.
-
WIFI_SCAN_THROTTLED
public static final LocationStatus WIFI_SCAN_THROTTLED
(Android 9 and superior only) The WiFi scan is throttled (see this article for details), and the WiFi scan interval will be changed to one scan every 30 seconds.
-
STOPPED
public static final LocationStatus STOPPED
TheLocationManager
has stopped (this may happen because of an error or after callingLocationManager.removeUpdates(LocationListener)
).
-
-
Method Detail
-
values
public static LocationStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LocationStatus c : LocationStatus.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LocationStatus valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap()
Description copied from interface:MapperInterface
Method to transform object into Map- Specified by:
toMap
in interfaceMapperInterface
- Returns:
- Map
with the information of the object mapped
-
-