Skip to content

Instantly share code, notes, and snippets.

@FilHazer
Created January 22, 2016 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FilHazer/8f9f50c1cccd70c1a18f to your computer and use it in GitHub Desktop.
Save FilHazer/8f9f50c1cccd70c1a18f to your computer and use it in GitHub Desktop.
public class Geo {
public String id;
public String name;
public double latitude;
public double longitude;
public int radius;
public Geofence geofence() {
id = UUID.randomUUID().toString();
return new Geofence.Builder()
.setRequestId(id)
.setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER | Geofence.GEOFENCE_TRANSITION_EXIT | Geofence.GEOFENCE_TRANSITION_DWELL)
.setLoiteringDelay(1000)
.setCircularRegion(latitude, longitude, radius)
.setExpirationDuration(Geofence.NEVER_EXPIRE)
.build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment