to top
Android APIs
public final class

GeofenceHardwareRequest

extends Object
java.lang.Object
   ↳ android.hardware.location.GeofenceHardwareRequest

Class Overview

This class represents the characteristics of the geofence.

Use this in conjunction with GeofenceHardware APIs.

Summary

Public Constructors
GeofenceHardwareRequest()
Public Methods
static GeofenceHardwareRequest createCircularGeofence(double latitude, double longitude, double radius)
Create a circular geofence.
int getLastTransition()
Returns the last transition of this geofence.
double getLatitude()
Returns the latitude of this geofence.
double getLongitude()
Returns the longitude of this geofence.
int getMonitorTransitions()
Returns transitions monitored for this geofence.
int getNotificationResponsiveness()
Returns the notification responsiveness of this geofence.
double getRadius()
Returns the radius of this geofence.
int getUnknownTimer()
Returns the unknownTimer of this geofence.
void setLastTransition(int lastTransition)
Set the last known transition of the geofence.
void setMonitorTransitions(int monitorTransitions)
Set the transitions to be monitored.
void setNotificationResponsiveness(int notificationResponsiveness)
Set the notification responsiveness of the geofence.
void setUnknownTimer(int unknownTimer)
Set the unknown timer for this geofence.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GeofenceHardwareRequest ()

Added in API level 18

Public Methods

public static GeofenceHardwareRequest createCircularGeofence (double latitude, double longitude, double radius)

Added in API level 18

Create a circular geofence.

Parameters
latitude Latitude of the geofence
longitude Longitude of the geofence
radius Radius of the geofence (in meters)

public int getLastTransition ()

Added in API level 18

Returns the last transition of this geofence.

public double getLatitude ()

Added in API level 18

Returns the latitude of this geofence.

public double getLongitude ()

Added in API level 18

Returns the longitude of this geofence.

public int getMonitorTransitions ()

Added in API level 18

Returns transitions monitored for this geofence.

public int getNotificationResponsiveness ()

Added in API level 18

Returns the notification responsiveness of this geofence.

public double getRadius ()

Added in API level 18

Returns the radius of this geofence.

public int getUnknownTimer ()

Added in API level 18

Returns the unknownTimer of this geofence.

public void setLastTransition (int lastTransition)

Added in API level 18

Set the last known transition of the geofence.

Parameters
lastTransition The current state of the geofence. Can be one of GEOFENCE_ENTERED, GEOFENCE_EXITED, GEOFENCE_UNCERTAIN.

public void setMonitorTransitions (int monitorTransitions)

Added in API level 18

Set the transitions to be monitored.

Parameters
monitorTransitions Bitwise OR of GEOFENCE_ENTERED, GEOFENCE_EXITED, GEOFENCE_UNCERTAIN

public void setNotificationResponsiveness (int notificationResponsiveness)

Added in API level 18

Set the notification responsiveness of the geofence.

Parameters
notificationResponsiveness (milliseconds) Defines the best-effort description of how soon should the callback be called when the transition associated with the Geofence is triggered. For instance, if set to 1000 millseconds with GEOFENCE_ENTERED, the callback will be called 1000 milliseconds within entering the geofence.

public void setUnknownTimer (int unknownTimer)

Added in API level 18

Set the unknown timer for this geofence.

Parameters
unknownTimer The time limit after which the GEOFENCE_UNCERTAIN transition should be triggered. This paramter is defined in milliseconds.