Class Locator

    Definition

    Namespace:
    Tizen.Location
    Assembly:
    Tizen.Location.dll

    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.

    public class Locator : IDisposable
    Inheritance
    object
    Locator
    Implements
    System.IDisposable

    Constructors

    View Source

    Locator(LocationType)

    The constructor of the Locator class.

    Declaration
    public Locator(LocationType locationType)
    Parameters
    Type Name Description
    LocationType locationType

    The back-end positioning method to be used for LBS.

    Exceptions
    Type Condition
    System.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.

    Properties

    View Source

    BatchInterval

    The time interval between the position collection in batch mode. Should be in the range of 1~255 seconds.

    Declaration
    public int BatchInterval { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    View Source

    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
    public int BatchPeriod { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    View Source

    Distance

    The distance between callback updates. Should be in the range of 1-120 meters.

    Declaration
    public double Distance { get; set; }
    Property Value
    Type Description
    double
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    View Source

    EnableMock

    Gets the status whether the mock location is enabled or not.

    Declaration
    public bool EnableMock { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    System.UnauthorizedAccessException

    Thrown when the application has no privilege to use the location.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    Interval

    The time interval between callback updates. Should be in the range of 1~120 seconds.

    Declaration
    public int Interval { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    View Source

    Location

    Gets the location object.

    Declaration
    public Location Location { get; }
    Property Value
    Type Description
    Location
    View Source

    LocationType

    Gets the type used to obtain the location data.

    Declaration
    public LocationType LocationType { get; }
    Property Value
    Type Description
    LocationType
    View Source

    StayInterval

    The time interval between the distance-based location callback updates. Should be in the range of 1~120 seconds.

    Declaration
    public int StayInterval { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    Methods

    View Source

    AddBoundary(LocationBoundary)

    Adds a bound for a given locator.

    Declaration
    public void AddBoundary(LocationBoundary locationBoundary)
    Parameters
    Type Name Description
    LocationBoundary locationBoundary

    The boundary object to be added to the locator.

    Exceptions
    Type Condition
    System.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.

    View Source

    ClearMock()

    Clears a mock location for the given location method.

    Declaration
    public void ClearMock()
    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when the operation is invalid for the current state.

    System.ArgumentException

    Thrown when an invalid argument is used.

    System.UnauthorizedAccessException

    Thrown when the application has no privilege to use the location.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    Dispose()

    The overidden Dispose method of the IDisposable class.

    Declaration
    public void Dispose()
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    View Source

    Dispose(bool)

    Dispose.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    View Source

    ~Locator()

    The destructor of the Locator class.

    Declaration
    protected ~Locator()
    View Source

    GetLocation()

    Gets the details of the location.

    Declaration
    public Location GetLocation()
    Returns
    Type Description
    Location

    Which contains the current location details.

    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when the operation is invalid for the current state.

    System.ArgumentException

    Thrown when an invalid argument is used.

    System.UnauthorizedAccessException

    Thrown when the application has no privilege to use the location.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    GetLocationAsync(int)

    Gets the details of the location asynchronously.

    Declaration
    public Task<Location> GetLocationAsync(int timeout)
    Parameters
    Type Name Description
    int timeout

    Timeout to stop requesting a single location after (seconds).

    Returns
    Type Description
    System.Threading.Tasks.Task<TResult><Location>

    A task which contains the current location details.

    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when the operation is invalid for the current state.

    System.ArgumentException

    Thrown when an invalid argument is used.

    System.UnauthorizedAccessException

    Thrown when the application has no privilege to use the location.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    RemoveBoundary(LocationBoundary)

    Deletes a bound for a given locator.

    Declaration
    public void RemoveBoundary(LocationBoundary locationBoundary)
    Parameters
    Type Name Description
    LocationBoundary locationBoundary

    The boundary object to be removed from the locator.

    Exceptions
    Type Condition
    System.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.

    View Source

    SetMockLocation(Location)

    Sets a mock location for the given location method.

    Declaration
    public void SetMockLocation(Location location)
    Parameters
    Type Name Description
    Location location

    The location object containing the mock location details.

    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when the operation is invalid for the current state.

    System.ArgumentException

    Thrown when an invalid argument is used.

    System.UnauthorizedAccessException

    Thrown when the application has no privilege to use the location.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    Start()

    Starts the Location Manager which has been created using the specified method.

    Declaration
    public void Start()
    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when the operation is invalid for the current state.

    System.ArgumentException

    Thrown when an invalid argument is used.

    System.UnauthorizedAccessException

    Thrown when the application has no privilege to use the location.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    Stop()

    Stops the Location Manager which has been activated using the specified method. Does not destroy the manager.

    Declaration
    public void Stop()
    Exceptions
    Type Condition
    System.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.

    Events

    View Source

    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
    public event EventHandler<LocationChangedEventArgs> DistanceBasedLocationChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><LocationChangedEventArgs>
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    LocationChanged

    The LocationUpdated event is raised at defined intervals of time with the updated location information. The callback will be invoked periodically.

    Declaration
    public event EventHandler<LocationChangedEventArgs> LocationChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><LocationChangedEventArgs>
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    ServiceStateChanged

    The ServiceStateChanged event is invoked when the location service state is changed.

    Declaration
    public event EventHandler<ServiceStateChangedEventArgs> ServiceStateChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><ServiceStateChangedEventArgs>
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    SettingChanged

    The SetttingChanged event is raised when the location setting is changed.

    Declaration
    public event EventHandler<SettingChangedEventArgs> SettingChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><SettingChangedEventArgs>
    Exceptions
    Type Condition
    System.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.

    View Source

    ZoneChanged

    The ZoneChanged event is invoked when the previously set boundary area is entered or left.

    Declaration
    public event EventHandler<ZoneChangedEventArgs> ZoneChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><ZoneChangedEventArgs>
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    System.NotSupportedException

    Thrown when the location is not supported.

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX