Class Locator
Definition
- Namespace:
- Tizen.Location
- Assembly:
- Tizen.Location.dll
- API Level:
- 3
This class contains the functionality for obtaining the geographical information and setting the boundary condition. Notifications on events like service becoming enabled or disabled, new position data being available, and others can also be acquired.
C#Copypublic class Locator : IDisposable
- Inheritance
-
Locator
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic Locator(LocationType locationType)
Parameters
Type | Name | Description |
---|---|---|
LocationType | locationType | The back-end positioning method to be used for LBS. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Feature: http://tizen.org/feature/location.gpshttp://tizen.org/feature/location.wps
Properties
BatchInterval
The time interval between the position collection in batch mode. Should be in the range of 1~255 seconds.
Declaration
C#Copypublic int BatchInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
API Level: 4
BatchPeriod
The time interval between batch callback updates. The BatchPeriod should be greater than or equal to the BatchInterval. If the BatchPeriod is zero or smaller than the BatchInterval, then the batch mode will not work. In addition, sometimes the period may not work as you intended, the maximum permissible value for the batch period is device specific. Should be in the range of 0~60000 seconds.
Declaration
C#Copypublic int BatchPeriod { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
API Level: 4
Declaration
C#Copypublic double Distance { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
API Level: 3
Declaration
C#Copypublic bool EnableMock { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when the application has no privilege to use the location. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/location
Interval
The time interval between callback updates. Should be in the range of 1~120 seconds.
Declaration
C#Copypublic int Interval { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
API Level: 3
Declaration
C#Copypublic Location Location { get; }
Property Value
Type | Description |
---|---|
Location |
API Level: 3
Declaration
C#Copypublic LocationType LocationType { get; }
Property Value
Type | Description |
---|---|
LocationType |
API Level: 3
StayInterval
The time interval between the distance-based location callback updates. Should be in the range of 1~120 seconds.
Declaration
C#Copypublic int StayInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
API Level: 3
Methods
Declaration
C#Copypublic void AddBoundary(LocationBoundary locationBoundary)
Parameters
Type | Name | Description |
---|---|---|
LocationBoundary | locationBoundary | The boundary object to be added to the locator. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Declaration
C#Copypublic void ClearMock()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
UnauthorizedAccessException | Thrown when the application has no privilege to use the location. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/location
Declaration
C#Copypublic void Dispose()
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
API Level: 3
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
API Level: 3
Declaration
C#Copyprotected void Finalize()
API Level: 3
Declaration
C#Copypublic Location GetLocation()
Returns
Type | Description |
---|---|
Location | Which contains the current location details. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
UnauthorizedAccessException | Thrown when the application has no privilege to use the location. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/location
Declaration
C#Copypublic Task<Location> GetLocationAsync(int timeout)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | timeout | Timeout to stop requesting a single location after (seconds). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Location> | A task which contains the current location details. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
UnauthorizedAccessException | Thrown when the application has no privilege to use the location. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/location
Declaration
C#Copypublic void RemoveBoundary(LocationBoundary locationBoundary)
Parameters
Type | Name | Description |
---|---|---|
LocationBoundary | locationBoundary | The boundary object to be removed from the locator. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Declaration
C#Copypublic void SetMockLocation(Location location)
Parameters
Type | Name | Description |
---|---|---|
Location | location | The location object containing the mock location details. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
UnauthorizedAccessException | Thrown when the application has no privilege to use the location. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/location
Declaration
C#Copypublic void Start()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
UnauthorizedAccessException | Thrown when the application has no privilege to use the location. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/location
Stop()
Stops the Location Manager which has been activated using the specified method. Does not destroy the manager.
Declaration
C#Copypublic void Stop()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
Events
DistanceBasedLocationChanged
The DistanceBasedLocationChanged event is raised with the updated location information. The callback will be invoked at a minimum interval or minimum distance with the updated position information.
Declaration
C#Copypublic event EventHandler<LocationChangedEventArgs> DistanceBasedLocationChanged
Event Type
Type | Description |
---|---|
System.EventHandler<LocationChangedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
LocationChanged
The LocationUpdated event is raised at defined intervals of time with the updated location information. The callback will be invoked periodically.
Declaration
C#Copypublic event EventHandler<LocationChangedEventArgs> LocationChanged
Event Type
Type | Description |
---|---|
System.EventHandler<LocationChangedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
ServiceStateChanged
The ServiceStateChanged event is invoked when the location service state is changed.
Declaration
C#Copypublic event EventHandler<ServiceStateChangedEventArgs> ServiceStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<ServiceStateChangedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
SettingChanged
The SetttingChanged event is raised when the location setting is changed.
Declaration
C#Copypublic event EventHandler<SettingChangedEventArgs> SettingChanged
Event Type
Type | Description |
---|---|
System.EventHandler<SettingChangedEventArgs> |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the operation is invalid for the current state. |
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |
API Level: 3
ZoneChanged
The ZoneChanged event is invoked when the previously set boundary area is entered or left.
Declaration
C#Copypublic event EventHandler<ZoneChangedEventArgs> ZoneChanged
Event Type
Type | Description |
---|---|
System.EventHandler<ZoneChangedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
System.NotSupportedException | Thrown when the location is not supported. |