5

There is any way to get the last post's made on a facebook wall into a Android app? I want to make some like a RSS reader to get some information on the app.

To explain better-

I have a page on facebook about one football club and there I post several information about news, games etc. Now I have made an android app and my question is whether I can import the post into the android application?

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
user2730344
  • 61
  • 1
  • 1
  • 5

1 Answers1

15

Of course, you can. First of all, if you are new to facebook integration- read the basics of the android integration, login/authorization calling its APIs etc. (not complex at all).

Facebook provides many APIs (for different functions) that uses the access token.

Based on your requirement, you just need to use the API: /PAGE_ID/feed with the page access token to get the feeds of your page. The page access_token can be obtained with the API: me/accounts?fields=access_token,name (Demo) after the user authorization/login.

You can test this API here: Graph API Explorer, using the default token already present there.


Smarter way

(Without using the facebook API)

Since your requirement involves only back-end processes, you can use this method.

  1. First of all, get the Long-lived page access token (that never expires). Detailed steps here. You can use the short-lived token from here.

  2. Use this token and make a \GET request to :

    https://graph.facebook.com/PAGE_ID/feed?access_token=TOKEN_FROM_STEP_1

    (You can check the result in the browser)

This is it!

Community
  • 1
  • 1
Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
  • thanks for you help. this will put on the correct way to try to make that. I'm new on this, many many thanks – user2730344 Sep 01 '13 at 21:36
  • @sahilmittal The link you posted works, but it just returns a bunch of JSON data. How do you convert that into a Facebook activity feed? – craned Oct 31 '14 at 16:16
  • 1
    I found the answer. I'd hoped there was some library to do it, but I couldn't find one. Instead, I used this [tutorial](http://www.androidhive.info/2014/06/android-facebook-like-custom-listview-feed-using-volley/) from AndroidHive. – craned Nov 06 '14 at 15:36