public interface GeofenceListener

Known subtypesGeofenceManager.Listener

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);
    }
}

Methods

public abstract void onExit(String id)This callback gets called once the device is out of the Geofence area
public abstract void onEntered(String id)This callback gets called once the device enters the Geofence area

Method details

onExit

public abstract void onExit(String id)
This callback gets called once the device is out of the Geofence area

onEntered

public abstract void onEntered(String id)
This callback gets called once the device enters the Geofence area