Android Open Source - ScoponeDaPolso Google Api Client Manager






From Project

Back to project page ScoponeDaPolso.

License

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.

Java Source Code

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());
    }

}




Java Source Code List

com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.BaseGameUtils.java
com.google.example.games.basegameutils.GameHelperUtils.java
com.google.example.games.basegameutils.GameHelper.java
com.mariux.teleport.lib.ApplicationTest.java
com.mariux.teleport.lib.TeleportClient.java
com.mariux.teleport.lib.TeleportService.java
org.gdg.bari.entities.ApplicationTest.java
org.gdg.bari.entities.Card.java
org.gdg.bari.entities.Constants.java
org.gdg.bari.entities.Deck.java
org.gdg.bari.entities.Score.java
org.gdg.bari.entities.TableTurn.java
org.gdg.bari.entities.Table.java
org.gdg.bari.entities.TeleportClientManager.java
org.gdg.bari.scopone.ApplicationTest.java
org.gdg.bari.scopone.activity.MobileGameActivity.java
org.gdg.bari.scopone.activity.MobileMainActivity.java
org.gdg.bari.scopone.activity.WearConfirmationActivity.java
org.gdg.bari.scopone.activity.WearMainActivity.java
org.gdg.bari.scopone.fragment.CardListFragment.java
org.gdg.bari.scopone.fragment.GameFragment.java
org.gdg.bari.scopone.fragment.LoginFragment.java
org.gdg.bari.scopone.fragment.MenuFragment.java
org.gdg.bari.scopone.service.MobileTeleportService.java
org.gdg.bari.scopone.services.WearTeleportService.java
org.gdg.bari.scopone.util.GoogleApiClientManager.java
org.gdg.bari.scopone.util.LogUtil.java