to top
Android APIs
public abstract class

GeofenceHardwareCallback

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

Class Overview

The callback class associated with the APIs in GeofenceHardware

Summary

Public Constructors
GeofenceHardwareCallback()
Public Methods
void onGeofenceAdd(int geofenceId, int status)
The callback called to notify the success or failure of the add call.
void onGeofencePause(int geofenceId, int status)
The callback called to notify the success or failure of the pause call.
void onGeofenceRemove(int geofenceId, int status)
The callback called to notify the success or failure of the remove call.
void onGeofenceResume(int geofenceId, int status)
The callback called to notify the success or failure of the resume call.
void onGeofenceTransition(int geofenceId, int transition, Location location, long timestamp, int monitoringType)
The callback called when there is a transition to report for the specific geofence.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GeofenceHardwareCallback ()

Added in API level 18

Public Methods

public void onGeofenceAdd (int geofenceId, int status)

Added in API level 18

The callback called to notify the success or failure of the add call.

public void onGeofencePause (int geofenceId, int status)

Added in API level 18

The callback called to notify the success or failure of the pause call.

Parameters
geofenceId The ID of the geofence.
status One of GEOFENCE_SUCCESS, GEOFENCE_ERROR_ID_UNKNOWN, GEOFENCE_FAILURE

public void onGeofenceRemove (int geofenceId, int status)

Added in API level 18

The callback called to notify the success or failure of the remove call.

Parameters
geofenceId The ID of the geofence.
status One of GEOFENCE_SUCCESS, GEOFENCE_ERROR_ID_UNKNOWN, GEOFENCE_FAILURE

public void onGeofenceResume (int geofenceId, int status)

Added in API level 18

The callback called to notify the success or failure of the resume call.

Parameters
geofenceId The ID of the geofence.
status One of GEOFENCE_SUCCESS, GEOFENCE_ERROR_ID_UNKNOWN, GEOFENCE_ERROR_INVALID_TRANSITION, GEOFENCE_FAILURE

public void onGeofenceTransition (int geofenceId, int transition, Location location, long timestamp, int monitoringType)

Added in API level 18

The callback called when there is a transition to report for the specific geofence.

Parameters
geofenceId The geofence ID of the geofence
transition One of GEOFENCE_ENTERED, GEOFENCE_EXITED, GEOFENCE_UNCERTAIN
location The last known location according to the monitoring system.
timestamp The timestamp (elapsed real time in milliseconds) when the transition was detected
monitoringType Type of the monitoring system.