public class LocationManager
extends java.lang.Object
LocationManager class provides access to geo-location related methods of the device.| Constructor and Description |
|---|
LocationManager()
This is the constructor of LocationManager.
|
| Modifier and Type | Method and Description |
|---|---|
int |
setLocationMode(LocationMode mode)
Set the GPS location provider mode.
|
public LocationManager()
DeviceException - in case of error.public int setLocationMode(LocationMode mode)
Note: on Android-Q onward, GPS and network sensors can't be toggled separately. For this reason any value
but LocationMode.OFF is interpreted as the location mode is on.
mode - LocationMode indicates the mode to use by the location provider.int DeviceException.SUCCESS in case of success,
otherwise a possible error code, matching one of the DeviceException error constants.DeviceException - in case of error, when exceptions are enabled through the ErrorManager singleton.