-
-
Save FilHazer/9ca4bf6ab55db0efe9b7 to your computer and use it in GitHub Desktop.
GeofenceController
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 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