Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GeofenceController
public class GeofenceController {
private static GeofenceController instance;
private GoogleApiClient googleApiClient;
public static GeofenceController getInstance() {
if (instance == null) {
instance = new GeofenceController();
}
return instance;
}
public void startGoogleApiClient(GoogleApiClient.ConnectionCallbacks callback, ConnectionFailedCallBack connectionFailedListener) {
googleApiClient = new GoogleApiClient.Builder(GeofenceApplication.CONTEXT)
.addApi(LocationServices.API)
.addConnectionCallbacks(callback)
.addOnConnectionFailedListener(connectionFailedListener)
.build();
googleApiClient.connect();
}
public void stopGoogleApiClient() {
googleApiClient.disconnect();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.