-
-
Save FilHazer/8f9f50c1cccd70c1a18f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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