java.lang.Object | |
↳ | com.google.android.gms.location.Geofence.Builder |
A builder that builds Geofence
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a geofence object.
| |||||||||||
Sets the region of this geofence.
| |||||||||||
Sets the expiration duration of geofence.
| |||||||||||
Sets the request ID of the geofence.
| |||||||||||
Sets the transition types of interest.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a geofence object.
IllegalArgumentException | if any parameters are not set or out of range |
---|
Sets the region of this geofence. The geofence represents a circular area on a flat, horizontal plane.
latitude | latitude in degrees, between -90 and +90 inclusive |
---|---|
longitude | longitude in degrees, between -180 and +180 inclusive |
radius | radius in meters |
Sets the expiration duration of geofence. This geofence will be removed automatically after this period of time.
durationMillis | time for this proximity alert, in milliseconds,
or NEVER_EXPIRE to indicate no expiration. When
positive, this geofence will be removed automatically
after this amount of time.
|
---|
Sets the request ID of the geofence. 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.
requestId | the request ID. The length of the string can be up to 100 characters. |
---|
Sets the transition types of interest. Alerts are only generated for the given transition types.
transitionTypes | geofence transition types of interest, as a bitwise-OR of GEOFENCE_TRANSITION_ flags. |
---|