User:Java
From Facebook Developer Wiki
Contents |
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.
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
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
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
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
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:
http://code.google.com/p/facebook-java-webapp/
Founder and Lead Developer
Facebook apps written in Java
moved to Facebook apps written in Java page
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: better alternative(Servlet Filters) to doing the authentication - w/ complete source 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
- Using Servlet Filters and Thread Locals for transparent access to the facebook client from backend service code
- zetallite.com: Getting Started - Creating a FBML Java Facebook Application
- 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).
Please add more :)
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.)
Bugs
Non-Java specific bugs are on the Bugs page.
