MACMAN
MACMAN

Reputation: 1971

How to Use Graph API directly inside an Android Application

What I would like to accomplish from my Android application is an ability to access facebook data. Without using Facebook SDK and by requesting Graph API directly, is it possible to extract data from facebook?

Upvotes: 0

Views: 683

Answers (2)

Nitzan Tomer
Nitzan Tomer

Reputation: 164129

As @Snicolas wrote the android sdk is mainly a wrapper for simple http request to facebook. You can make those requests yourself without the use of the sdk but it will just make the process more "painful".

Here are some advantages of using the sdk:

  1. Single Sign On: Probably the most important pro for using the sdk is that with the SSO you remove the annoying process of login to facebook, as you might be aware it's not fun to type your e-mail and password on mobile devices.

  2. Graph errors are already parsed for you and are thrown as exceptions, no need for you to check the response for errors.

  3. Easy access to performs all requests in async mode.

  4. Use simple path (i.e.: "/me/feed") instead of full urls, also the sdk adds the access token to all requests automatically.

  5. The sdk is an official one, maintained by facebook, so you know that it is up to date (as long as you keep your version updated)

  6. The sdk comes with some ui dialogs in the well known facebook style, this both saves you time of creating the ui yourself, and gives the users a familiar ui.

Now, why don't you want to use the sdk? What do you expect to gain from interacting with the graph api directly?

Upvotes: 3

Snicolas
Snicolas

Reputation: 38168

For sure, Look at the code of the Facebook SDK for android. It's merely a wrapper for http requests, you can do them by yourself. But, to be honest, this wrapper is worth it.

Upvotes: 3

Related Questions