Represents a geographical region, also known as a geofence. Geofences can be monitored by geofencer service. And when the user crosses the boundary of a geofence, an alert will be generated.
| class | Geofence.Builder | A builder that builds Geofence. |
|
| @interface | Geofence.GeofenceTransition | Geofence transition event. | |
| @interface | Geofence.TransitionTypes | Geofence transition types of interest, as either
0 or a bitwise-OR of GEOFENCE_TRANSITION_ flags. |
|
| int | GEOFENCE_TRANSITION_DWELL | The transition type indicating that the user enters and dwells in geofences for a given period of time. |
| int | GEOFENCE_TRANSITION_ENTER | The transition type indicating that the user enters the geofence(s). |
| int | GEOFENCE_TRANSITION_EXIT | The transition type indicating that the user exits the geofence(s). |
| long | NEVER_EXPIRE | Expiration value that indicates the geofence should never expire. |
| abstract long |
getExpirationTime()
Returns the expiration elapsed realtime of geofence in milliseconds, or
NEVER_EXPIRE if there's no expiration.
|
| abstract double |
getLatitude()
Returns latitude in degrees, between -90 and +90 inclusive.
|
| abstract int |
getLoiteringDelay()
Returns the delay between
GEOFENCE_TRANSITION_ENTER and
GEOFENCE_TRANSITION_DWELL in milliseconds.
|
| abstract double |
getLongitude()
Returns longitude in degrees, between -180 and +180 inclusive.
|
| abstract int |
getNotificationResponsiveness()
Returns the best-effort description of how soon should the callback be called
when the transition associated with the geofence is triggered, in milliseconds.
|
| abstract float |
getRadius()
Returns radius in meters.
|
| abstract String |
getRequestId()
Returns the request ID of this geofence.
|
| abstract int |
getTransitionTypes()
Returns the transition types of interest as a bitwise-OR of
GEOFENCE_TRANSITION_ flags.
|
The transition type indicating that the user enters and dwells in geofences for a
given period of time. If
GEOFENCE_TRANSITION_ENTER is also specified, this alert will always be sent
after the
GEOFENCE_TRANSITION_ENTER alert.
You must set the duration of loitering before this alert is sent using
Geofence.Builder.setLoiteringDelay(int).
The transition type indicating that the user enters the geofence(s).
The transition type indicating that the user exits the geofence(s).
Expiration value that indicates the geofence should never expire.
Returns the expiration elapsed realtime of geofence in milliseconds, or
NEVER_EXPIRE
if there's no expiration. When positive, this geofence will be removed automatically
after that time.
Returns latitude in degrees, between -90 and +90 inclusive.
Returns the delay between
GEOFENCE_TRANSITION_ENTER and
GEOFENCE_TRANSITION_DWELL in milliseconds.
Returns longitude in degrees, between -180 and +180 inclusive.
Returns the best-effort description of how soon should the callback be called when the transition associated with the geofence is triggered, in milliseconds.
Returns radius in meters.
Returns the request ID of this geofence. The request ID is a string to identify this geofence inside your application. When two geofences with the same requestId are monitored, the new one will replace the old one regardless the geographical region these two geofences represent.
Returns the transition types of interest as a bitwise-OR of
GEOFENCE_TRANSITION_ flags.