// Establish a Geofence around a circular region defined by a
// defined origin and radius. A Geofence can also be defined
// as a polygon. The specified GeofenceListener will be notified
// when the BlackBerry device enters or exits the perimeter of the
// geofenced region.
final Geofence geofence = new Geofence();
final Coordinates coordinates =
new Coordinates(ORIGIN_LATITUDE, ORIGIN_LONGITUDE,
Float.NaN);
geofence.monitorPerimeter(this, "RIM Campus", coordinates,
GEOFENCE_RADIUS, 0, -1);
// Add a field to display status
final StringBuffer strBuffer =
new StringBuffer("Geofence enabled for latitude ");