Android Facebook - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Facebook class.

This code example shows how to use the following methods:isSessionValid, setAccessExpires, setAccessToken
This code example shows how to use the following methods:isSessionValid, setAccessExpires, setAccessToken
This code example shows how to use the following methods:getAccessToken
	//================================================================// 
 
	//----------------------------------------------------------------//	 
	public static String getToken () {
 
		return sFacebook.getAccessToken (); 
	} 
	 
	//----------------------------------------------------------------//	 
	public static void init ( String appId ) {
		 
		sFacebook = new Facebook ( appId ); 
		sFacebook.extendAccessTokenIfNeeded ( sActivity, null );
	} 
 
	//----------------------------------------------------------------//	 
	public static boolean isSessionValid () { 
 
		return sFacebook.isSessionValid ();
	} 
8
CodeRank
This code example shows how to use the following methods:isSessionValid, setAccessExpires, setAccessToken
This code example shows how to use the following methods:dialog, getAccessExpires, getAccessToken
	} 
 
	@Override 
	public void onComplete(Bundle values) {
		SharedPreferences.Editor editor = mPrefs.edit();
		editor.putString("access_token", facebook.getAccessToken());
		editor.putLong("access_expires", facebook.getAccessExpires());
		editor.commit();
 
		// Send app requests 
		facebook.dialog(ctx, "apprequests",
				new AppRequestsListener()); 
	} 
 
	@Override 
	public void onFacebookError(FacebookError e) {
	} 
 
	@Override 
	public void onError(DialogError e) {
7
CodeRank
This code example shows how to use the following methods:authorize, isSessionValid, setAccessExpires, setAccessToken
	} 
 
	public boolean restoreCredentials(Facebook facebook) {
		SharedPreferences sharedPreferences = getApplicationContext()
				.getSharedPreferences(KEY, Context.MODE_PRIVATE);
		facebook.setAccessToken(sharedPreferences.getString(TOKEN, null));
		facebook.setAccessExpires(sharedPreferences.getLong(EXPIRES, 0));
		return facebook.isSessionValid();
	} 
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
 
		Bundle b = this.getIntent().getExtras();
 
		messageToPost = b.getString("message");
		imageLink = b.getString("imageLink");
		description = b.getString("description");
		caption = b.getString("caption");

7
CodeRank
This code example shows how to use the following methods:isSessionValid, setAccessExpires, setAccessToken
This code example shows how to use the following methods:isSessionValid, setAccessExpires, setAccessToken
This code example shows how to use the following methods:isSessionValid, setAccessExpires, setAccessToken
This code example shows how to use the following methods:isSessionValid, setAccessExpires, setAccessToken

Related Android Facebook Questions & Answers:

See Code Examples for Android Facebook Methods: