Interface GeofenceListener
- All Known Implementing Classes:
GeofenceManager.Listener
public interface GeofenceListener
Listener interface for the Geofence background tracking functionality. Usage:
// File: BGLocationTest.java
public void showForm() {
Form hi = new Form("Hi World");
hi.addComponent(new Label("Hi World"));
Location loc = new Location();
loc.setLatitude(51.5033630);
loc.setLongitude(-0.1276250);
Geofence gf = new Geofence("test", loc, 100, 100000);
LocationManager.getLocationManager().addGeoFencing(GeofenceListenerImpl.class, gf);
hi.show();
}
// File: GeofenceListenerImpl.java
public class GeofenceListenerImpl implements GeofenceListener {
public void onExit(String id) {
System.out.println("Exited "+id);
}
public void onEntered(String id) {
System.out.println("Entered "+id);
}
}
-
Method Summary
-
Method Details
-
onExit
This callback gets called once the device is out of the Geofence area -
onEntered
This callback gets called once the device enters the Geofence area
-