Android AppStateClient - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android AppStateClient class.

This code example shows how to use the following methods:isConnected, loadState
 
  public static void loadState(int stateKey)
  { 
    try 
    { 
      if(appStateClient != null && appStateClient.isConnected())
      { 
        appStateClient.loadState(new GooglePlayCallback("APP_STATE_CLIENT"),
            stateKey);
 
        Log.i("trace", "Loading state: " + stateKey);
      } 
    } 
    catch(Exception e)
    { 
      handleException(e, "loadState");
    } 
  } 
 
  public static void updateState(int stateKey, String data)
5
CodeRank
This code example shows how to use the following methods:disconnect, isConnected
                && mPlusClient.isConnected()) {
            mConnectedClients &= ~CLIENT_PLUS;
            mPlusClient.disconnect();
        } 
        if ((whatClients & CLIENT_APPSTATE) != 0 && mAppStateClient != null
                && mAppStateClient.isConnected()) {
            mConnectedClients &= ~CLIENT_APPSTATE;
            mAppStateClient.disconnect();
        } 
    } 
	 
	public void onSignOutComplete() { 
		if (mGamesClient.isConnected())
            mGamesClient.disconnect();
		UnitySendMessageSafe("GPGAuthResult", "signedout"); 
	} 
 
	public void onConnectionFailed(ConnectionResult result) {
		// save connection result for later reference 
        mConnectionResult = result;
5
CodeRank
This code example shows how to use the following methods:disconnect, isConnected
This code example shows how to use the following methods:disconnect, isConnected
This code example shows how to use the following methods:disconnect, isConnected
This code example shows how to use the following methods:disconnect, isConnected
This code example shows how to use the following methods:connect
                 
                break; 
            case CLIENT_APPSTATE:
            	mParentActivity.runOnUiThread(new Runnable() {
					public void run() { 
						mAppStateClient.connect();
					} 
            	}); 
                 
                break; 
            case CLIENT_PLUS:
            	mParentActivity.runOnUiThread(new Runnable() {
            		public void run() { 
            			mPlusClient.connect();
            		} 
            	}); 
                break; 
        } 
    } 
	 
5
CodeRank
This code example shows how to use the following methods:disconnect, isConnected
This code example shows how to use the following methods:disconnect, isConnected
This code example shows how to use the following methods:isConnected, reconnect
                && mGamesClient.isConnected()) {
            mConnectedClients &= ~CLIENT_GAMES;
            mGamesClient.reconnect();
        } 
        if ((whatClients & CLIENT_APPSTATE) != 0 && mAppStateClient != null
                && mAppStateClient.isConnected()) {
            mConnectedClients &= ~CLIENT_APPSTATE;
            mAppStateClient.reconnect();
        } 
    } 
 
    /** Called when we successfully obtain a connection to a client. */ 
    @Override 
    public void onConnected(Bundle connectionHint) {
        debugLog("onConnected: connected! client=" + mClientCurrentlyConnecting);
         
        // Mark the current client as connected 
        mConnectedClients |= mClientCurrentlyConnecting;
         
        // If this was the games client and it came with an invite, store it for later 
5
CodeRank

Related Android AppStateClient Questions & Answers:

See Code Examples for Android AppStateClient Methods: