Wednesday, 18 July 2012

FacebookIntegration into android application

Steps for Facebook Integration in Android:
The Aim of this article is, to get Facebook integration into our Android Application.

1.Apply for a Facebook Application ID (APP_ID):
For this, we need a facebook account to create our own application.This link will help to create a new application in our account.Click Here
In this site, top corner of the right side, we have an option to create an application i.e
Create New App. Just click on that.. It moves to new window, and need to provide application name and namespace.
Next, it moves to the Our application information page. It contains the App ID , App secret ID and some basic Information.
Here is the screen shot: 
2. Include the Facebook APP_ID in your Android Application:
We need to include the APP_ID into our android application.
So far so good, everything is setup on the Facebook front, now it’s time to start coding our Android application.
On the Android front, we’ll use the Facebook Android SDK located at Github: DownLoad Here

The Facebook Android SDK is licensed under the Apache License and is completely 
open source.
The project contains several samples in the examples folder, but the core SDK is located in the facebook folder.

Here is the full source Code:SourceCode

3. Import the sdk into our application:
This sdk , we will import into our sample application for facebook intraction purpose.

This sdk contains 5 java classes, those are manage to intraction of facebook.

4. Our Sample Applicatoin:
Main page:
This page contains the login button. By using this, first we login to our facebook account.
Then after, in our application contains the few implementations to intraction with facebook. Those are:
                                   1. Update Status.
        1. App Requests
        2. Uploaded photos
        3. Get Friends
        4. Current Location
Few Screen Shots in our Application:
After Updating status in FB

Update Status

Login Screen
Main Page

Here is the Reference Link: Click Here

No comments:

Post a Comment