Class GeofenceManager
Definition
- Assembly:
- Tizen.Location.Geofence.dll
The Geofence Manager API provides service related to geofence (geo-fence). Geofence is a virtual perimeter for a real-world geographic area. This API provides functions to set geofence with a geopoint, MAC address of Wi-Fi, and Bluetooth address. Also, notifications on events like changing in service status are provided. There are two kinds of places and fences:
- Public places and fences are created by the MyPlace application that can be used by all applications.
- Private places and fences are created by the specified application that can be used by the same application.
- Zone in when a device enters a specific area.
- Zone out when a device exits a specific area.
- Results and errors for each event requested to the geofence module.
C#Copypublic class GeofenceManager : IDisposable
- Inheritance
-
objectGeofenceManager
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic GeofenceManager()
Exceptions
Type | Condition |
---|---|
System.OutOfMemoryException | In case of out of memory condition. |
System.InvalidOperationException | In case of any system error. |
System.NotSupportedException | In case the geofence is not supported. |
Properties
Declaration
C#Copypublic static bool IsSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Declaration
C#Copypublic void Dispose()
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Declaration
C#Copyprotected ~GeofenceManager()
Declaration
C#Copypublic void Start(int geofenceId)
Parameters
Type | Name | Description |
---|---|---|
int | geofenceId | The specified geofence ID. |
Remarks
When the location service is enabled, the StateChanged event is invoked and the service starts.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | In case of an invalid parameter. |
System.InvalidOperationException | In case of any system error. |
System.UnauthorizedAccessException | In case privileges are not defined. |
System.NotSupportedException | In case the geofence is not supported. |
Declaration
C#Copypublic void Stop(int geofenceId)
Parameters
Type | Name | Description |
---|---|---|
int | geofenceId | The specified geofence ID. |
Remarks
This function initiates the process of stopping the service. You can stop and start the Geofence manager as needed.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | In case of an invalid parameter. |
System.InvalidOperationException | In case of any system error. |
System.UnauthorizedAccessException | In case privileges are not defined. |
System.NotSupportedException | In case the geofence is not supported. |
Events
GeofenceEventChanged
Called when some event occurs in the geofence and the place, such as add, update, etc.. The events of public geofence is also received if there are public geofences.
Declaration
C#Copypublic event EventHandler<GeofenceResponseEventArgs> GeofenceEventChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><GeofenceResponseEventArgs> |
Remarks
Call to Start() will invoke this event. The value of place_id or geofence_id is -1 when the place ID or geofence ID is not assigned.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | In case the feature is not supported. |
Declaration
C#Copypublic event EventHandler<ProximityStateEventArgs> ProximityChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><ProximityStateEventArgs> |
Remarks
Call to Start() will invoke this event.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | In case the feature is not supported. |
StateChanged
Invokes when a device enters or exits the given geofence if this event is registered.
Declaration
C#Copypublic event EventHandler<GeofenceStateEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><GeofenceStateEventArgs> |
Remarks
Call to Start() will invoke this event.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | In case the feature is not supported. |