| CLASS info |
| public static class Builder |
| Class for building the Geofence object. |
| Return type | Method name |
| Geofence.Builder | setRoundArea(double latitude, double longitude, float radius) |
| Geofence.Builder | setUniqueId(String uniqueId) |
| Geofence.Builder | setConversions(int conversions) |
| Geofence.Builder | setValidContinueTime(long validContinueTime) |
| Geofence.Builder | setDwellDelayTime(int dwellDelayTime) |
| Geofence.Builder | setNotificationInterval(int notificationInterval) |
| Geofence.Builder | build() |
| Method |
| public Geofence.Builder setRoundArea(double latitude, double longitude, float radius) |
This API is used to set the region of a geofence. |
Parameters
| Parameter name | Parameter desc |
| latitude | Latitude. The value range is [-90,90]. |
| longitude | Longitude. The value range is [-180,180]. |
| radius | Radius, in meters. |
Return
| type | desc |
| 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 name | Parameter desc |
| uniqueId | Unique ID. If the unique ID already exists, the new geofence will overwrite the old one. |
Return
| type | desc |
| Geofence.Builder | Geofence builder. |
| Method |
| public Geofence.Builder setConversions(int conversions) |
This API is used to set the conversions of a geofence. |
Parameters
| Parameter name | Parameter desc |
| conversions | Geofence conversions. The bitwise-OR operation is supported. |
Return
| type | desc |
| Geofence.Builder | Geofence builder. |
| Method |
| public Geofence.Builder setValidContinueTime(long validContinueTime) |
This API is used to set the geofence timeout interval. |
Parameters
| Parameter name | Parameter desc |
| validContinueTime | Geofence timeout interval, in milliseconds. The geofence will be automatically deleted after this amount of time. |
Return
| type | desc |
| 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 name | Parameter 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
| type | desc |
| Geofence.Builder | Geofence builder. |
| Method |
| public Geofence.Builder setNotificationInterval(int notificationInterval) |
This API is used to set the notification response capability. |
Parameters
| Parameter name | Parameter 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
| type | desc |
| Geofence.Builder | Geofence builder. |
| Method |
| public Geofence build() |
This API is used to build a geofence object |
Return
| type | desc |
| Geofence | Geofence object. |