Back to project page ScoponeDaPolso.
The source code is released under:
GNU General Public License
If you think the Android project ScoponeDaPolso listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.gdg.bari.scopone.util; /*from w ww . ja va 2 s.c o m*/ import android.content.Context; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.games.Games; import com.google.android.gms.plus.Plus; public class GoogleApiClientManager { private static final String TAG = GoogleApiClientManager.class.getSimpleName(); private static GoogleApiClient mInstance = null; public static GoogleApiClient getInstance(Context context) { LogUtil.d(TAG, TAG + " getInstance() method"); if (mInstance == null) { LogUtil.d(TAG, TAG + " : GoogleApiClient == null"); // Create the Google API Client with access to Plus and Games mInstance = new GoogleApiClient.Builder(context) .addConnectionCallbacks((GoogleApiClient.ConnectionCallbacks) context) .addOnConnectionFailedListener((GoogleApiClient.OnConnectionFailedListener) context) .addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN) .addApi(Games.API).addScope(Games.SCOPE_GAMES) .build(); } return mInstance; } /** * Restituisce lo stato del GoogleApiClient * * @return true se connesso, false altrimenti */ public static boolean isConnected() { return (mInstance != null) && (mInstance.isConnected()); } }