2013-08-02

Hi Guys!

Today I going to share about the Facebook Integration with Android App.
The Facebook SDK for Android is the easiest way to integrate your Android app with Facebook's platform. The SDK provides support for Login with Facebook authentication, reading and writing to Facebook APIs and support for UI elements such as pickers and dialogs.

What I am going to implement watch in video.

The First thing is Download and extract the SDK ZIP file. The resulting folder, facebook-android-sdk-3.0.2, contains the SDK itself. We need to add this sdk library with our new android app project.

Now the second thing is need to get the SHA1 (Hash Key). For this we need to download the openssl and install in our system and configure with the system environment variable. Here is the link to download the setup OpenSsl. 
And set the path like that C:\Program Files (x86)\GnuWin32\bin (this is default directory to install in your system).
In the next step we have to create a folder inside the C drive name "Android" and copy the debug.keystore (default directory in my system is "C:\Users\sunil\.android") and paste inside thie Android folder.

Now the time is to generate the sha1 key by using the keystore file so use this command
C:\>keytool -exportcert -alias androiddebugkey -keystore "C:\Android\debug.keystore" | openssl sha1 -binary | openssl base64



 Once run this command then it asking about password then give password "android". Then it will generate the app id.

Now need to use this app id with your Facebook account. So logged your Facebook Account and click on developer tab and click on Apps tab.


 
You need to registered as a developer and save your SHA1 key here.



In the next step we need to create the new app then go to dashboard Apps tab and create new app.

After that it show the app id and secret app id

So you can use this APP ID  in your android project.

Lets create the the android project name "First Android" and add the facebook sdk as a library.

Lets start the coding now.

activity_main.xml

MainActivity.java

You can download the source code First Android.

Show more