Android Open Source - acs-android-sdk Demo Application






From Project

Back to project page acs-android-sdk.

License

The source code is released under:

Apache License

If you think the Android project acs-android-sdk 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 com.appcelerator.cloud.demo;
/*from   ww  w. j a v a 2 s. c om*/
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import android.app.Application;
import android.content.Context;
import android.preference.PreferenceManager;

import com.appcelerator.cloud.sdk.CCRequestMethod;
import com.appcelerator.cloud.sdk.CCResponse;
import com.appcelerator.cloud.sdk.ACSClient;
import com.appcelerator.cloud.sdk.ACSClientError;

public class DemoApplication extends Application {
  // TODO Update your own app_id here
  public static final String APP_ID = "<YOUR APP ID>";
  public static final String FACEBOOK_APP_ID = "";
  // TODO Update your own oAuth account here
  public static final String APP_CONSUMER_KEY = "<YOUR APP CONSUMER KEY>";
  public static final String APP_CONSUMER_SECRET = "<YOUR APP CONSUMER SECRET>";
  private static ACSClient sdk = null;
  private static DemoSession session = null;

  @Override
  public void onCreate() {
    PreferenceManager.setDefaultValues(this, R.xml.default_values, false);

    // Initialize ACSClient
    initialize(APP_CONSUMER_KEY, APP_CONSUMER_SECRET, getApplicationContext());
  }

  private static void initialize(String appConsumerKey, String appConsumerSecret, Context appContext) {
//    Pass app key to the 'key' argument
//    sdk = new ACSClient(APP_ID, appContext);
//    Pass both oauth key and secret
//    sdk = new ACSClient(appConsumerKey, appConsumerSecret, appContext);
    
    //Pass both oauth key and secret and use 3-legged oauth
//    sdk = new ACSClient(appConsumerKey, appConsumerSecret, appContext);
    //for authentication/authorization with Authorization Server
//    sdk.useThreeLegged(true);
    
//    Use 3-legged OAuth but without OAuth secret specified - the 'key' argument expects OAuth key
//    sdk = new ACSClient(appConsumerKey, appContext);
//    sdk.useThreeLegged(true);
//    sdk = new ACSClient("iJ0BL5CHUc5sbAojXFgRhfffKWCYkf0u"); // app key
        
    sdk.setDlgCustomizer(new MyDlgCustomizer());
    session = new DemoSession();
  }

  @Override
  public void onTerminate() {
  }

  public static ACSClient getSdk() {
    return sdk;
  }

  public static DemoSession getSession() {
    return session;
  }
}




Java Source Code List

com.appcelerator.cloud.demo.BaloonLayout.java
com.appcelerator.cloud.demo.CheckinAdapter.java
com.appcelerator.cloud.demo.DemoApplication.java
com.appcelerator.cloud.demo.DemoSession.java
com.appcelerator.cloud.demo.Explore.java
com.appcelerator.cloud.demo.MyDlgCustomizer.java
com.appcelerator.cloud.demo.PlaceAdapter.java
com.appcelerator.cloud.demo.PlaceView.java
com.appcelerator.cloud.demo.SignUp.java
com.appcelerator.cloud.demo.TabView.java
com.appcelerator.cloud.demo.UserView.java
com.appcelerator.cloud.pushdemo.ArrivalActivity.java
com.appcelerator.cloud.pushdemo.CustomReceiver.java
com.appcelerator.cloud.pushdemo.ExtendedReceiver.java
com.appcelerator.cloud.pushdemo.GCMUtility.java
com.appcelerator.cloud.pushdemo.PushActivity.java
com.appcelerator.cloud.pushdemo.PushNotificationsManager.java
com.appcelerator.cloud.sdk.ACSClientError.java
com.appcelerator.cloud.sdk.ACSClient.java
com.appcelerator.cloud.sdk.CCConstants.java
com.appcelerator.cloud.sdk.CCMeta.java
com.appcelerator.cloud.sdk.CCMultipartEntity.java
com.appcelerator.cloud.sdk.CCObject.java
com.appcelerator.cloud.sdk.CCPagination.java
com.appcelerator.cloud.sdk.CCRequestMethod.java
com.appcelerator.cloud.sdk.CCResponse.java
com.appcelerator.cloud.sdk.CCUser.java
com.appcelerator.cloud.sdk.SerializableCookie.java
com.appcelerator.cloud.sdk.oauth2.ACSClientDialog.java
com.appcelerator.cloud.sdk.oauth2.DialogError.java
com.appcelerator.cloud.sdk.oauth2.DialogListener.java
com.appcelerator.cloud.sdk.oauth2.DlgCustomizer.java
com.appcelerator.cloud.sdk.oauth2.Util.java
com.appcelerator.com.cloud.demotest.TestDriver.java