Package com.skyhookwireless.wps
Interface GeoFenceCallback
-
public interface GeoFenceCallbackCallback routine forIWPS.setGeoFence().
For a WPS_GEOFENCE_ENTER geofence, this callback will be called whenever the user enters the geofence (but only once for as long as the user remains inside the geofence).
For a WPS_GEOFENCE_LEAVE geofence, this callback will be called whenever the user leaves the geofence (but only once for as long as the user remains outside the geofence).
Sample Code:
public WPSContinuation handleGeoFence(final WPSGeoFence geofence, final WPSLocation location) { if (geofence.getType() == WPSGeoFence.Type.WPS_GEOFENCE_ENTER) { System.out.println("entering"); } else // geofence.getType() == WPSGeoFence.Type.WPS_GEOFENCE_LEAVE { System.out.println("leaving"); } final String pattern = " geofence" + " ({0,number,#.######}," + " {1,number,#.######}" + " +/-{2, number,#}m)" + " at {3,number,#.######}," + " {4,number,#.######}" + " +/-{5, number,#}m"; System.out.println(MessageFormat.format(pattern, geofence.getLatitude(), geofence.getLongitude(), geofence.getRadius(), location.getLatitude(), location.getLongitude(), location.getHPE())); return WPSContinuation.WPS_CONTINUE; }- Since:
- 4.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WPSContinuationhandleGeoFence(WPSGeoFence geofence, WPSLocation location)
-
-
-
Method Detail
-
handleGeoFence
WPSContinuation handleGeoFence(WPSGeoFence geofence, WPSLocation location)
- Parameters:
geofence- that triggered this callbacklocation- that triggered this callback- Returns:
WPS_CONTINUEif this geofence tracking should continue,
WPS_STOPif tracking should be cancelled (and no more callbacks will be invoked).
-
-