Back to project page post-to-friendfeed.
The source code is released under:
Copyright (c) 2010, Larry Myers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: R...
If you think the Android project post-to-friendfeed listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.larrymyers.android.posttoff; //w ww . ja va 2s . com import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; public class AuthPrefAdapter implements AuthAdapter { private Context mCtx; public AuthPrefAdapter(Context ctx) { this.mCtx = ctx; } public void close() { // nothing to do here } public void createAuth(Auth auth) { SharedPreferences prefs = mCtx.getSharedPreferences("prefs", 0); Editor editor = prefs.edit(); editor.putString("username", auth.getUsername()); editor.putString("remoteKey", auth.getRemoteKey()); editor.commit(); } public Auth getAuth() { SharedPreferences prefs = mCtx.getSharedPreferences("prefs", 0); Auth auth = new Auth(); auth.setUsername(prefs.getString("username", null)); auth.setRemoteKey(prefs.getString("remoteKey", null)); return auth; } public void updateAuth(Auth auth) { createAuth(auth); } }