User:Java
From Facebook Developer Wiki
Contents |
[edit] Java Libraries
Facebook does not have an "official" library developed by the Facebook Platform team ( see here ) but there are several Java libraries that are very well developed and frequently updated.
[edit] Facebook-Java-Api
Currently, the most active and mature Facebook Java API is an open-source project built around what was previously the official Facebook Java client.
Please visit the project's homepage and follow links to the getting started documentation and active forum where you can post Java-related questions.
http://code.google.com/p/facebook-java-api/
- Updated 7th March 2009 by David Boden
[edit] TinyFBClient and TinyFBTagLib
Added April 15th 2009.
TinyFBClient - A very small, but powerful Facebook Java client.
TinyFBTaglib - Tags that can be added to JSP pages to call the Facebook API.
Usage and how-to (includes Google App Engine support): Social Java Site.
Support and discussion: Social Java: Facebook Group
App created with tags. Give it a try! Shout Out
Let me know what you think, Carmen http://www.socialjava.com and http://www.brightkeep.com
[edit] fb4j
- **NEWS** December 2, 2008: fb4j User Forums now online!!! Sign up for support for fb4j alpha and to provide your input to the coming 2.0 release!
fb4j is an API for Facebook written for Java developers, by Java developers. fb4j demystifies Facebook application development by providing a consistent, intuitive object model that allows easy access to all of the functionality of the Facebook API. fb4j is easy to use, and provides full support for authentication as well as JSON and XML interfaces. Documentation, source and binaries can be found at:
Enjoy! -Mino & Gino
[edit] JavaBook
There is a new java-based library for Facebook that uses JSON. The current version is an ALPHA, so please do expect bugs. It is, however, on Google Code so it's open source and you can help make it better. It's available at:
http://code.google.com/p/javabook/
Have fun! -- Benjamin
[edit] Facebook Java Webapp
This application aims to provide a quick and easy way for building Java Web Applications for Facebook. It aims to provide a fast-track and all-inclusive dive deep into how the Facebook Web Applications can be built. So you can take this projects as an application model then you refactor it to meet your needs:
- Project site
- Sources note: the download link on the project's "Sources" tab is not working
- Cesar - Founder and Lead Developer
- ohloh.net: Article discussing it
[edit] RestFB
Added April 2nd, 2010
RestFB is a simple and flexible REST API client with little conceptual weight. It provides a minimal but powerful interface for interacting with the API and handles the grunt work of marshaling JSON to Java objects, using annotations for configuration. Easy extensibility and testability allow you to fully control all parts of the library and drop in mock implementations of each core component for straightforward unit testing.
[edit] Facebook apps written in Java
moved to Facebook apps written in Java page
[edit] Tutorials and Example Code
- T=Machine: How to make Facebook apps using Java part 1 (very basic stuff)
- T=Machine: How to make Facebook apps using Java part 2 (authentication, login servlet, example source for callback servlet)
- T=Machine: ...part 3 (aka: 10 tips and tricks for writing facebook apps)
- theliveweb.net: FaceBook authentication using Java - a better alternative (Servlet Filters) to doing the authentication - w/ complete source code
- The servlet filter in this article doesn't cache the authenticated client between several requests. To do so, refer to James Roper's ThreadLocal article (next one in this list).
- Using Servlet Filters and Thread Locals for transparent access to the Facebook client from back-end service code
- I finally found the way to connect, authenticate and be able to use facebook methods here !
- How to make a "Hello World"-like app in Wicket
- zetallite.com: Getting Started - Creating a FBML Java Facebook Application
- The original article is no longer available. You can see view it in an archived version from 2008-06-12.
- Choka's blog: Crear aplicaciones en Facebook usando Java (spanish tutorial)
- Socialjava.com: Recreate Step-by-Step PHP Facebook example in Java-source code included
- Multiple Page Java/JSP Example. Java-source code included
- Random Friend picks a Friend and shows the friend on your profile. Java/JSP (source code and readme).
- IBM article: Develop a Facebook application with Eclipse Galileo (22 Dec 2009)
- Summary: This article is for any Eclipse developer who wants to learn how to use the mature Web Tools Platform release of Galileo to develop, debug, and deploy a restaurant-search Facebook application. Along the way, you will take advantage of various aspects of the Facebook Application API and the Facebook Connect API.
- fonicmonkey: 7 essential planning tips when developing your application on Facebook Platform (February 11th, 2008)
- fonicmonkey: Java JSP code example: A Facebook “invite your friends” panel (February 22nd, 2008)
- spring-security-facebook - Facebook integration with Spring Security, presented in this blog entry
- developer.com: Writing Facebook Applications Using Java EE By PJ Cabrera (March 13, 2008)
Please add more :)
[edit] Advice
- Don't forget to set the callback URL for your application.
If it is not set, the FacebookRestClient will throw an exception.
- Use Java 5.0 or higher
- If you are using http://apps.facebook.com/yourappname/yourpagename to create a page within FaceBook,
then you must only return an FBML fragment, and not a full HTML page.
- FacebookRestClient.notifications_sendRequest is quite fussy about the FBML it will accept.
It normally returns a url when successful. You must then redirect the user to that url or the requests will not go through.
- When testing your application using a local machine server (for example, Tomcat on port 8080)
Set your callbackURL to http://localhost:8080/yourappname Then open a new window in your browser, log into facebook and type in your url: http://apps.facebook.com/yourappname You can now see the page that your server normally sends back to your browser but within the facebook site frames. Make sure your server is working normally before testing it with facebook. (10/01/2009: This needs to be an address that Facebook servers can reach through the Internet, not a local network address. Therefore, http://localhost is not a valid URL.)
[edit] Bugs
Non-Java specific bugs are on the Bugs page.
