Android Facebook Integration


Okay, I found this a little (but only a little) tougher than integrating Twitter (with Twitter4J library) in your Android applications, but this is how it works:

  • Download the Facebook Android SDK from https://github.com/facebook
  • Extract the zip file.
  • Inside it, there is a folder called 'Facebook' . Its the SDK reference we'll be using.
  • Open up Eclipse and 'Create a new project from existing source' (I hope you know how to do it, if not, add a comment in the end), and select the Facebook SDK folder you just extracted, as the source.
  • Remember, this is just a reference project, thus you cant get an APK out of it.
  • Now create your new project.
  • Right click on your project>Properties>Android>Library
  • Select the above imported Facebook SDK as the library
  • Done, now look at the sample project I have here. It updates your facebook status after asking for login.
(sample project: https://github.com/Sheikh-Aman/Android_Samples/tree/master/3.%20FacebookExample-StatusUpdate)

There are some more IMPORTANT steps to take which are discussed here in detail. Do read them to understand what my project does. Though this sample project works, but that's because I followed all those steps.

Since its a very short and quick post, If you face any problem at any level, just ping me.