code: public void connect(String endpointID, String appID, boolean shouldReconnect, final Object initialPresence, Context context, final ConnectCompletionListener completionListener) {
          if ((endpointID != null) && (appID != null) && (endpointID.length() > 0) && (appID.length() > 0)) {
              connectionInProgress = true;
              reconnect = shouldReconnect;
              applicationID = appID;
              appContext = context;
  
              APIGetToken request = new APIGetToken(context, baseURL) {
                  @Override
                  public void transactionComplete() {
                      super.transactionComplete();
  
                      if (success) {
                          connect(this.token, initialPresence, appContext, new ConnectCompletionListener() {
                              @Override
                              public void onError(final String errorMessage) {
                                  connectionInProgress = false;
  
                                  postConnectError(completionListener, errorMessage);
                              }
                          });
                      } else {
                          connectionInProgress = false;
  
                          postConnectError(completionListener, this.errorMessage);
                      }
                  }
              };
  
              request.appID = appID;
              request.endpointID = endpointID;
              request.go();
          } else {
              postConnectError(completionListener, "AppID and endpointID must be specified");
          }
      }
docs: Connect to the Respoke infrastructure and authenticate in development mode using the specified endpoint ID and app ID.
  Attempt to obtain an authentication token automatically from the Respoke infrastructure.
  
  @param endpointID          The endpoint ID to use when connecting
  @param appID               Your Application ID
  @param shouldReconnect     Whether or not to automatically reconnect to the Respoke service when a disconnect occurs.
  @param initialPresence     The optional initial presence value to set for this client
  @param context             An application context with which to access system resources
  @param completionListener  A listener to be called when an error occurs, passing a string describing the error