Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'd like to write a program in java (not a servlet, not jsp, not a webapp) which allows me to do simple things, such as connecting to a FB account and retrieve the status or posts on the wall. I know facebook no longer supports official JavaAPI, so I was wondering what are the best (and most simple, being the program very basic) unofficial api out there. If possible, i would also like some example-code.

searching through the web, I've read that you need two secret keys to create a facebook application, and I have not a fb account. Is it indispensable to have an account?

thank you everyone

share|improve this question

closed as off-topic by gnat, Bart van Ingen Schenau, MichaelT, Snowman, GlenH7 Dec 30 '14 at 1:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Bart van Ingen Schenau, MichaelT, Snowman, GlenH7
If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

up vote 3 down vote accepted

You can try RestFB which, despite its name, doesn't only use the (now about to be deprecated) Facebook Rest API, but also the Graph API, which is the one Facebook currently recommends using. You can integrate it in a plain old Java Desktop application (meaning that you don't need to be in the context of a Java EE WebApp to use it).

share|improve this answer

As said by Shivan Dragon, RestFB can be used even in Java Desktop applications and handles it well enough.

Yet, you need a facebook app (that requires a registered user) and connection (there are 3 forms: Javascript, native device and server-side). You should check the general architecture, but the server-side is probably the best option for you.

share|improve this answer

Check this Article first

It gives good pieces of information to start with that simple task.

You may check a sample working code posted @ Ideone

Required jars:

  1. facebook4j
  2. apache commons - collections
  3. BeanUtils
  4. apache commons - lang
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.