Search in sources :

Example 21 with OAuthToken

use of com.googlecode.flickrjandroid.oauth.OAuthToken in project glimmr by brk3.

the class LoginFragment method persistAccessToken.

private void persistAccessToken(OAuth oauth) {
    SharedPreferences sp = mActivity.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = sp.edit();
    OAuthToken token = oauth.getToken();
    User user = oauth.getUser();
    editor.putString(Constants.KEY_OAUTH_TOKEN, token.getOauthToken());
    editor.putString(Constants.KEY_TOKEN_SECRET, token.getOauthTokenSecret());
    editor.putString(Constants.KEY_ACCOUNT_USER_NAME, user.getUsername());
    editor.putString(Constants.KEY_ACCOUNT_USER_ID, user.getId());
    editor.commit();
}
Also used : OAuthToken(com.googlecode.flickrjandroid.oauth.OAuthToken) User(com.googlecode.flickrjandroid.people.User) SharedPreferences(android.content.SharedPreferences)

Aggregations

OAuthToken (com.googlecode.flickrjandroid.oauth.OAuthToken)21 Flickr (com.googlecode.flickrjandroid.Flickr)19 OAuth (com.googlecode.flickrjandroid.oauth.OAuth)13 FlickrException (com.googlecode.flickrjandroid.FlickrException)3 IOException (java.io.IOException)3 SharedPreferences (android.content.SharedPreferences)2 User (com.googlecode.flickrjandroid.people.User)2 JSONException (org.json.JSONException)2 RequestContext (com.googlecode.flickrjandroid.RequestContext)1 SearchParameters (com.googlecode.flickrjandroid.photos.SearchParameters)1 FileInputStream (java.io.FileInputStream)1 URL (java.net.URL)1 Date (java.util.Date)1