Android Open Source - Android_Oauth_Demo Utils






From Project

Back to project page Android_Oauth_Demo.

License

The source code is released under:

MIT License

If you think the Android project Android_Oauth_Demo 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.example.sdnusdk;
//w w w. jav a 2s.c  om
import android.content.Context;
import android.content.SharedPreferences;

public class Utils {
  //????????????,
  public static final String SDNUSDKDEMO = "SDNU_SDK_DEMO";
  public static final String TOKENVALUE= "TOKEN_VALUE";  
  
  private static SharedPreferences  preferences;
  public static  String getTokenValue(Context mContext ,String key,int mode){
     preferences = mContext.getSharedPreferences(SDNUSDKDEMO,mode);
     String value=preferences.getString(key, "");
     return value;    
  }
  
  public static  void saveTokenValue(Context mContext ,String value,String key,int mode){
     preferences = mContext.getSharedPreferences(SDNUSDKDEMO,mode);
     preferences.edit().putString(key, value).commit();
  }

}




Java Source Code List

.LoginActivity.java
com.example.sdnusdk.MainActivity.java
com.example.sdnusdk.Utils.java
com.example.sdnusdk.WelcomeActivity.java