Can anybody have demo code to get user data (like Username,last name) from his facebook account in to the java code? I have gone thru the sample API but it will help me to reduce my work if I can use some reusable code.
Thank you hp
Can anybody have demo code to get user data (like Username,last name) from his facebook account in to the java code? I have gone thru the sample API but it will help me to reduce my work if I can use some reusable code.
Thank you hp
Facebook Java API Google Group: http://code.google.com/p/facebook-java-api/
Examples of the FB Java API (including what you're looking for): http://code.google.com/p/facebook-java-api/wiki/Examples
One suggestion I have would be to use Google Web Toolkit and/or the Apache HTTP Client.
GWT: http://code.google.com/webtoolkit/ Let's you write complex web-app code in Java, and automatically ports it to Javascript for you. No servlets required.
Apache HTTP Client: http://hc.apache.org/httpcomponents-client-ga/ Provides helper methods for things such as AJAX calls, sending/receiving data, passing cookies/parameters with requests, etc.
Just have a look at Facebook's API, and mess around with either of these tools. Also, have a look at these official Facebook resources:
Facebook API Sandbox: https://developers.facebook.com/tools/console/
Facebook Developer App: https://www.facebook.com/developers/
Sample Apps: https://developers.facebook.com/docs/samples/
Note that the facebook-java-api project is now dead.
Use instead: http://restfb.com/