All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE

All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE - Welcome to ANDROID KAWE, Ini adalah sebuah blog directory tentang burung,baik itu suara burung ataupun tips perawatan burung.Blog ini adalah situs perangkum otomatis dari pencarian google yang kali ini berjudul All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE.Ada ribuan artikel yang sudah terekam ke dalam situs ini,silahkan cari sesuai yang kalian kehendaki,untuk artikel selanjutnya tentang judul diatas bisa kalian baca di bawah ini.

Konten : All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE
Judul : All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE

lihat juga


All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE


Quick integration of facebook on android platform



Hello Creative Android Developers,


This post is explaining the integration of facebook a powerful social media with android applications.


facebook the powerful social media provides the enrich developer APIs to integrate the facebook features in applications. You can create lots of derivative social apps from facebook and can add a social touch to your app with facebook interaction.


This post is focusing on developing the android application with facebook APIs. The facebook SDK could be download from https://github.com/facebook/facebook-android-sdk/


Once you download the facebook-android-sdk you need to create an android project to compile the facebook-android-sdk code and create a library for facebook APIs.


Now you can create your sample code by using the above library as reference in your application.


Create a simple android application project and replace the activity code as follows.


You need to register your application on facebook platform and get the application id from the platform.

package com.example.samplefacebook;

import android.os.Bundle;

import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
import com.facebook.android.*;
import com.facebook.android.Facebook.*;


public class MainActivity extends Activity {


@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}


Facebook facebook = new Facebook("YOUR APP ID");

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

facebook.authorize(this, new DialogListener() {
@Override
public void onComplete(Bundle values) {}

@Override
public void onFacebookError(FacebookError error) {}

@Override
public void onError(DialogError e) {}

@Override
public void onCancel() {}
});
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

facebook.authorizeCallback(requestCode, resultCode, data);
}

}


This is the simple code for invoking the login interface with single-sign-on (SSO) of the facebook from your android application. 


You need to add the following permission to access the facebook platform.


Add the following line in AndroidManifest.xml of the sample.

<uses-permission android:name="android.permission.INTERNET"/>

Now running the application we show the following output

facebook on android
Facebook - (SSO) in Android App

Now you can make your apps more social with facebook. If you like the post then please provide your feedback.


Thanks
Creative Android Apps





Demikianlah Artikel All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE

Semoga artikel tentang All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE, mudah-mudahan bisa memberi manfaat untuk anda semua.

Anda sedang membaca artikel All About Android-Integrating Facebook in Android Apps-ANDROIDKAWE dan artikel ini url permalinknya adalah http://androidkawe.blogspot.com/2012/07/all-about-android-integrating-facebook.html Semoga artikel ini bisa bermanfaat.Sekali lagi,ini adalah situs auto yang tidak ditulis langsung oleh admin,Kami tidak menjamin akan kebenaran dari artikel yang tertulis.
Back To Top