Request a Quote
+91-33-40200868 info@brand-maestro.com

How to Integrate Facebook API On Android – steps you will need

Posted in: Mobile App Develop & Design Started by

How to Integrate Facebook API On Android – steps you will need

Life without social networking sites like Twitter and Facebook is pretty hard to imagine. Especially with more and more people feeling the urge to stay connected even while on the go, it has become really necessary for any mobile app development company to integrate Facebook API in mobile devices. However, users can integrate this by themselves without the need of professional assistance. Since the number of users of Android is quite high, this blog will guide you in the social media platform integration in Android devices.

For the integration you need a test account of the social networking site along with an application of social networking site. Didn’t get it? Scroll down :

facebook api- mobile app development

The first step; how to create a test account for smooth integration of Facebook API for Android

A test account must be created to be used in the Android application. Then a new user account must be signed up for at the social networking site. If there is an account already then the existing name can be used for signing up for new account. However a separate email address must be specified. After creating the account it must be converted into a test account. After logging in the social media platform, visit the page called Facebook Become Test Account so that the newly created account can be converted to a test account. After confirming it you will receive a confirmation message.

Second step- creating Facebook application

Now a Facebook application must be created. The integration is dependent on OAuth 2.0, requiring registration of an application for the social networking site. For the implementation, the Facebook Developers Authentication page must be visited. There will be a separate Application ID of the application created for use in Android application. The application can be created only through a proper and real Facebook account; here the test account cannot be used. So use the real one and visit the Create Application to create it. A name must be given to it and the registration will be complete. Now the Android application must be coded. You can use Facebook Android SDK that is located at Github which is open source and licensed under Apache License; any good mobile app development company can help you out with necessary information.
The API provided by the Facebook Connector will be more course-grained when compared to the class. The generic design of the class allows you or a mobile app development company to make several calls to social media platform and the API designed by you is quite fine-grained. A course-grained method is exposed by the FacebookConnector known as postMessageOnWall which is main logic behind the Post button. There is just another thing that you have to provide, the message that you want to post. The necessary plumbing will be done by the connector. This method just checks if the social networking site session carried on by you is valid or not. The necessary parameters are then setup and call is made so that your message can be posted on the wall.

 

mobile app development- facebook api

How to post message on any wall through Facebook API for Android?

For message posting on the wall, you must construct a Bundle or message that can be passed to request method. Then the “me/feed” ID has to be used on Facebook Graph API so that you can indicate that the Profile feed will be posted with something. The method of postMessageOnWall is called from the main Activity in background threads. However you should not interrupt the main thread of UI during the message posting but you can send the user a notification that the message has been posted. A handler can be used for this so that a Test message can be shown on the main thread after completing the background processing.
Through Android Facebook SDK you can easily integrate the social networking site into an Android application. This method is used by any experienced mobile app development company since single sign on capabilities are provided by it which prevents users from logging in again if Facebook session had been established already once. You can also take advantage of an authentication or authorization mechanism which is much simpler. So, what do you think? Game for a try?

Leave a Reply