Interface LocationManager
- 
public interface LocationManagerThis class provides Situm Indoor and / or Outdoor positioning. In essence, this class allows you to:- Start the positioning by calling the method 
requestLocationUpdates(LocationRequest, LocationListener)with:- A
LocationRequestwith the positioning configuration parameters: Building vs Global, whether or not to use WiFi or BLE, etc.- A
LocationListenerto receive generated geolocations and other information (status and errors). - Stop the positioning by  calling the method 
LocationManager.removeUpdates(). 
Before using any of this class methods, you must call
SitumSdk.init(Context). Also, before you use this class, the user will need to grant the following runtime permissions:- ACCESS_COARSE_LOCATION. Required if you use Situm SDK in Building Mode (positioning restricted to Indoor Positions within a predefined building). Building Mode can be configured using the 
LocationRequest.setBuildingIdentifier()method. - ACCESS_FINE_LOCATION. Required if you use Situm SDK in Global Mode (positioning anywhere, Indoors or Outdoors, with automatic building detection). Global Mode is the default mode when building the 
LocationRequest. 
- See Also:
 LocationRequest,Location,LocationListener
 - Start the positioning by calling the method 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceLocationManager.CodeThe error codes that theLocationManagercan generate (all errors will be communicated through theLocationListener.onError(Error)callback).static interfaceLocationManager.PropertyKey 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisRunning()Returns true ifLocationManager.requestLocationUpdates()was called and positioning is runningvoidremoveUpdates(LocationListener locationListener)Stops positioning, removing all location updates for the givenLocationListener.voidrequestLocationUpdates(LocationRequest locationRequest, LocationListener locationListener)Starts positioning with the configuration specified by theLocationRequest; computed geolocations, status codes and errors will be received through theLocationListenercallbacks.voidupdateLocationParameters(LocationParametersUpdate locationParametersUpdate, LocationParametersUpdateListener locationParametersUpdateListener)Updates positioning parameters on the fly (without stopping and re-starting positioning). 
 - 
 
- 
- 
Method Detail
- 
requestLocationUpdates
void requestLocationUpdates(@NonNull LocationRequest locationRequest, @NonNull LocationListener locationListener)Starts positioning with the configuration specified by theLocationRequest; computed geolocations, status codes and errors will be received through theLocationListenercallbacks.You may call this method more than once, with the following effect:
- If you provide a new 
LocationRequestinstance, positioning will be re-started with the new positioning options specified by this new instance. - If you provide a new 
LocationListener, the former LocationListener will be replaced, therefore geolocations will be communicated to the new one. - If neither 
LocationRequestnorLocationListenerchange, nothing will happen. 
You may stop positioning at any time by calling the
Since: 2.50.1 - When positioning in Global Mode, in case of encountering any error (e.g. network failure, corrupt data in a building, etc.), positioning will stop and inform of the error. In previous versions, Situm SDK would retry endlessly (except in case of network errors).LocationManager.removeUpdates()method.- Parameters:
 locationRequest- the location request with the positioning configuration parameters: Building vs Global, whether or not to use WiFi or BLE, etc.locationListener- the listener to notify the generated geolocations, and other information (status and errors).
 - If you provide a new 
 
- 
removeUpdates
void removeUpdates(@NonNull LocationListener locationListener)Stops positioning, removing all location updates for the givenLocationListener.- Parameters:
 locationListener- the listener to remove
 
- 
updateLocationParameters
void updateLocationParameters(@NonNull LocationParametersUpdate locationParametersUpdate, @NonNull LocationParametersUpdateListener locationParametersUpdateListener)Updates positioning parameters on the fly (without stopping and re-starting positioning).When the LocationManager is running (
LocationManager.isRunning()is true), this method provides a convenient way to change the positioning parameters without re-starting positioning (that is, without callingLocationManager.removeUpdates()andLocationManager.requestLocationUpdates()again).This method has no effect if the LocationManager is not running (
LocationManager.isRunning()is false).- Parameters:
 locationParametersUpdate- object containing parameters to be modified. SeeLocationParametersUpdatefor a detailed description.locationParametersUpdateListener- listener that will be notified with the states that the update process goes through. The process of updating parameters is an asynchronous operation that involves a series of states that will be communicatied via theLocationParametersUpdateListener. All these methods will be called on the main thread.Version: 0.0.1 Since: Starting from version of the SDK 2.41.0
 
- 
isRunning
boolean isRunning()
Returns true ifLocationManager.requestLocationUpdates()was called and positioning is running- Returns:
 - true if positioning is running, false otherwise
 
 
 - 
 
 -