目录

CLASS info
public static class Builder
Class for building the Geofence object.

Public Method Summary

Return typeMethod name
Geofence.BuildersetRoundArea(double latitude, double longitude, float radius)
Geofence.BuildersetUniqueId(String uniqueId)
Geofence.BuildersetConversions(int conversions)
Geofence.BuildersetValidContinueTime(long validContinueTime)
Geofence.BuildersetDwellDelayTime(int dwellDelayTime)
Geofence.BuildersetNotificationInterval(int notificationInterval)
Geofence.Builderbuild()

Public Methods

Method
public Geofence.Builder setRoundArea(double latitude, double longitude, float radius)

This API is used to set the region of a geofence.

Parameters

Parameter nameParameter desc
latitude

Latitude. The value range is [-90,90].

longitude

Longitude. The value range is [-180,180].

radius

Radius, in meters.

Return

typedesc
Geofence.Builder

Geofence builder.

Method
public Geofence.Builder setUniqueId(String uniqueId)

This API is used to set the unique ID of a geofence.

Parameters

Parameter nameParameter desc
uniqueId

Unique ID. If the unique ID already exists, the new geofence will overwrite the old one.

Return

typedesc
Geofence.Builder

Geofence builder.

Method
public Geofence.Builder setConversions(int conversions)

This API is used to set the conversions of a geofence.

Parameters

Parameter nameParameter desc
conversions

Geofence conversions. The bitwise-OR operation is supported.

Return

typedesc
Geofence.Builder

Geofence builder.

Method
public Geofence.Builder setValidContinueTime(long validContinueTime)

This API is used to set the geofence timeout interval.

Parameters

Parameter nameParameter desc
validContinueTime

Geofence timeout interval, in milliseconds. The geofence will be automatically deleted after this amount of time.

Return

typedesc
Geofence.Builder

Geofence builder.

Method
public Geofence.Builder setDwellDelayTime(int dwellDelayTime)

 This API is used to set the lingering duration for converting a geofence event.

Parameters

Parameter nameParameter desc
dwellDelayTime

Lingering duration for converting a geofence event, in milliseconds. A geofence event is converted when a user lingers in a geofence for this amount of time.

Return

typedesc
Geofence.BuilderGeofence builder.
Method
public Geofence.Builder setNotificationInterval(int notificationInterval)

This API is used to set the notification response capability.

Parameters

Parameter nameParameter desc
notificationInterval

Notification response capability. The default value is 0. Setting it to a larger value can reduce power consumption accordingly. However, reporting of geofence events may be delayed.

Return

typedesc
Geofence.BuilderGeofence builder.
Method
public Geofence build()

This API is used to build a geofence object

Return

typedesc
Geofence

Geofence object.