Search code examples
androidsharedpreferencesonedrivelive-sdk

Android livesdk how to getharedPreferences after LiveAuthClient


I am using following source https://github.com/liveservices/LiveSDK-for-Android.

Do someone know how to get shared preferences after the LiveAuthClient process. I have to get REFRESH_TOKEN_KEY and COOKIE_DELIMITER from the sharedprefences file and clear it after saving it in a database. The aim is to save this to values in a database to login with multiple skydrive accounts.

Any ideas would be helpful. Thank you.


Solution

  • If Someone wants to know use:

    /** Name of the preference file */
    public static final String FILE_NAME = "com.microsoft.live";
    public static final String COOKIES_KEY = "cookies";
    public static final String REFRESH_TOKEN_KEY = "refresh_token";
    
    SharedPreferences preferences = getSharedPreferences(SDriveConstants.FILE_NAME, Context.MODE_PRIVATE);
    String refresh_tkn_key = preferences.getString(SDriveConstants.REFRESH_TOKEN_KEY, "");
    String cookies_key = preferences.getString(SDriveConstants.COOKIES_KEY, "");