How to write Facebook applications in Java?

I searched in vain for a good example or starting point for writing a Java-based facebook application ... I was hoping someone here would find out about this. Also, I heard that facebook no longer supports their java APIs, that’s true, and if so, that means we should no longer use java to write facebook applications.

+6
java api facebook
source share
6 answers

Facebook stopped supporting the official Java API on May 5, 2008, according to their developer wiki .

This does not mean that you should no longer use Java to write FB applications. There are several alternative Java approaches on the wiki.

You can also check out this project ; however, it appeared only a few days ago, therefore YMMV.

+6
source share

There is a community project that aims to upgrade the Java Java API to this day, using the old official Facebook code as a starting point.

You can find it here along with a getting started guide and a few bits of example code.

+6
source share

I am writing an example using facebook java api It uses FacebookXmlRestClient to make a client request and print all user data http://programmaremobile.blogspot.com/2009/01/facebook-java-apieng.html

+2
source share

BatchFB provides a modern Java API that allows you to easily optimize your Facebook calls to a minimal set:

http://code.google.com/p/batchfb/

Here is an example taken from the main page of what you can effectively do in a single FB request:

/** You write your own Jackson user mapping for the pieces you care about */ public class User { long uid; @JsonProperty("first_name") String firstName; String pic_square; String timezone; } Batcher batcher = new FacebookBatcher(accessToken); Later<User> me = batcher.graph("me", User.class); Later<User> mark = batcher.graph("markzuckerberg", User.class); Later<List<User>> myFriends = batcher.query( "SELECT uid, first_name, pic_square FROM user WHERE uid IN" + "(SELECT uid2 FROM friend WHERE uid1 = " + myId + ")", User.class); Later<User> bob = batcher.queryFirst("SELECT timezone FROM user WHERE uid = " + bobsId, User.class); PagedLater<Post> feed = batcher.paged("me/feed", Post.class); // No calls to Facebook have been made yet. The following get() will execute the // whole batch as a single Facebook call. String timezone = bob.get().timezone; // You can just get simple values forcing immediate execution of the batch at any time. User ivan = batcher.graph("ivan", User.class).get(); 
+1
source share

You might want to try Spring Social . It may be limited in terms of Facebook features, but it also allows you to connect to Twitter, LinkedIn, TripIt, GitHub and Gowalla.

The other side is that since Facebook adds features, some of the older APIs may break, so using a simpler clean FB api (which you can update when something doesn't work) might be a good idea.

0
source share

In this tutorial, you will literally go through everything you need: http://ocpsoft.org/opensource/creating-a-facebook-app-setup-and-tool-installation/

It consists of three parts. The remaining 2 are connected from there.

0
source share

All Articles