Android Open Source - allblue-all-in-one Shared O Auth Token






From Project

Back to project page allblue-all-in-one.

License

The source code is released under:

MIT License

If you think the Android project allblue-all-in-one 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.allblue.util;
//from  w  ww.ja  v a 2 s . c  o  m

import android.content.Context;
import android.content.SharedPreferences;

public class SharedOAuthToken {

  private static SharedPreferences mSettings;
  private static String SHARED_INFO = "SHARED_INFO";

  private static final String TOKEN = "token";
  private static final String SECRET = "secret";
  
  private SharedOAuthToken() {}
  
  public static void saveRequestInformation(String token, String secret) {
    SharedPreferences.Editor editor = mSettings.edit();

    editor.putString(TOKEN, token);
    
    editor.putString(SECRET, secret);
    
    editor.commit();
  }

  public static void setSettings(Context context, int mode) {
    mSettings = context.getSharedPreferences(SHARED_INFO, mode);
  }

  public static String getRequestToken() {
    return mSettings.getString(TOKEN, null);
  }

  public static String getRequestSecret() {
    return mSettings.getString(SECRET, null);
  }
}




Java Source Code List

org.allblue.DashBoard.java
org.allblue.activity.GlobalActivity.java
org.allblue.activity.HomeActivity.java
org.allblue.activity.OAuthActivity.java
org.allblue.activity.SettingActivity.java
org.allblue.activity.SingleTabActivity.java
org.allblue.adapter.SettingAdapter.java
org.allblue.adapter.SingleTabCursorAdapter.java
org.allblue.database.DatabaseConfig.java
org.allblue.database.DatabaseHelper.java
org.allblue.metadata.AccountTypes.java
org.allblue.metadata.Account.java
org.allblue.metadata.SinaAccount.java
org.allblue.metadata.TweetItem.java
org.allblue.metadata.TwitterAccount.java
org.allblue.util.OAuthUtil.java
org.allblue.util.SharedOAuthToken.java
org.allblue.util.XMLUtil.java