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
Share Improve this question edited Apr 20, 2011 at 0:49 Himanshu 1,99916 silver badges12 bronze badges asked Apr 20, 2011 at 0:48 GendafulGendaful 5,81213 gold badges59 silver badges78 bronze badges 6- TO be more specific, when user Logsin , He should get the username, his basic info like name, lastname and his likes.Thank you – Gendaful Commented Apr 20, 2011 at 0:51
- 2 Facebook API is homework now? I remember professors doing everything they could to keep kids off facebook in lecture. "The times, they are a changin'" – corsiKa Commented Apr 20, 2011 at 0:51
- Hmmm, if I remember correctly "reusable code" in school when I was in school was synonymous with "cheating." Are you sure the point of the assignment wasn't to write said code? – Chris Thompson Commented Apr 20, 2011 at 0:53
- No sir :), its not assignment :) – Gendaful Commented Apr 20, 2011 at 0:55
- possible duplicate of How can I use Facebook JAVA API in my application? – Mohamed Mansour Commented Apr 20, 2011 at 1:07
2 Answers
Reset to default 2Facebook Java API Google Group: http://code.google./p/facebook-java-api/
Examples of the FB Java API (including what you're looking for): http://code.google./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./webtoolkit/ Let's you write plex web-app code in Java, and automatically ports it to Javascript for you. No servlets required.
Apache HTTP Client: http://hc.apache/httpponents-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./tools/console/
Facebook Developer App: https://www.facebook./developers/
Sample Apps: https://developers.facebook./docs/samples/
Note that the facebook-java-api project is now dead.
Use instead: http://restfb./