Class Fence
Definition
- Namespace:
- Tizen.Location.Geofence
- Assembly:
- Tizen.Location.Geofence.dll
- API Level:
- 3
Geofence defines a virtual perimeter for a real-world geographic area. If you create a geofence, you can trigger some activities when a device enters (or exits) the geofences defined by you. You can create a geofence with the information of the Geopoint, Wi-Fi, or BT.
- Geopoint: Geofence is specified by the coordinates (Latitude and Longitude) and radius.
- WIFI: Geofence is specified by the BSSID of the Wi-Fi access point.
- BT: Geofence is specified by the Bluetooth address.
public class Fence : IDisposable
- Inheritance
-
Fence
- Implements
Properties
View SourceAddress
Gets the address of geofence.
Declaration
public string Address { get; }
Property Value
Type | Description |
---|---|
String |
API Level: 3
View SourceBssid
Gets the BSSID of geofence.
Declaration
public string Bssid { get; }
Property Value
Type | Description |
---|---|
String |
API Level: 3
View SourceLatitude
Gets the latitude of geofence.
Declaration
public double Latitude { get; }
Property Value
Type | Description |
---|---|
Double |
API Level: 3
View SourceLongitude
Gets the longitude of geofence.
Declaration
public double Longitude { get; }
Property Value
Type | Description |
---|---|
Double |
API Level: 3
View SourcePlaceId
Gets the ID of the place.
Declaration
public int PlaceId { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: 3
View SourceRadius
Gets the radius of geofence.
Declaration
public int Radius { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: 3
View SourceSsid
Gets the SSID of geofence.
Declaration
public string Ssid { get; }
Property Value
Type | Description |
---|---|
String |
API Level: 3
View SourceType
Gets the type of geofence.
Declaration
public FenceType Type { get; }
Property Value
Type | Description |
---|---|
FenceType |
API Level: 3
Methods
View SourceCreateBTFence(Int32, String, String)
Creates a Bluetooth type of the new geofence.
Declaration
public static Fence CreateBTFence(int placeId, string bssid, string ssid)
Parameters
Type | Name | Description |
---|---|---|
Int32 | placeId | The current place ID. |
String | bssid | Specifies the value of BSSID of BT MAC address. |
String | ssid | Specifies the value of SSID of BT Device. |
Returns
Type | Description |
---|---|
Fence | The newly created geofence instance. |
Exceptions
Type | Condition |
---|---|
ArgumentException | In case of an invalid parameter. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case the geofence is not supported. |
API Level: 3
View SourceCreateGPSFence(Int32, Double, Double, Int32, String)
Creates a geopoint type of the new geofence.
Declaration
public static Fence CreateGPSFence(int placeId, double latitude, double longitude, int radius, string address)
Parameters
Type | Name | Description |
---|---|---|
Int32 | placeId | The current place ID. |
Double | latitude | Specifies the value of latitude of the geofence [-90.0 ~ 90.0] (degrees). |
Double | longitude | Specifies the value of longitude of the geofence [-180.0 ~ 180.0] (degrees). |
Int32 | radius | Specifies the value of radius of the geofence [100 ~ 500] (meter). |
String | address | Specifies the value of the address. |
Returns
Type | Description |
---|---|
Fence | The newly created geofence instance. |
Exceptions
Type | Condition |
---|---|
ArgumentException | In case of an invalid parameter. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case the geofence is not supported. |
API Level: 4
View SourceCreateWifiFence(Int32, String, String)
Creates a Wi-Fi type of the new geofence.
Declaration
public static Fence CreateWifiFence(int placeId, string bssid, string ssid)
Parameters
Type | Name | Description |
---|---|---|
Int32 | placeId | The current place ID. |
String | bssid | Specifies the value of BSSID of the Wi-Fi MAC address. |
String | ssid | Specifies the value of SSID of the Wi-Fi device. |
Returns
Type | Description |
---|---|
Fence | The newly created geofence instance. |
Exceptions
Type | Condition |
---|---|
ArgumentException | In case of an invalid parameter. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case the geofence is not supported. |
API Level: 3
View SourceDispose()
The overloaded Dispose API for destroying the fence handle.
Declaration
public void Dispose()
API Level: 3
View SourceDispose(Boolean)
Dispose.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
API Level: 3
View SourceFinalize()
The destructor of the Fence class.
Declaration
protected void Finalize()