最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Demo example for how to get data of your facebook account in to your java class? - Stack Overflow

matteradmin5PV0评论

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
 |  Show 1 more ment

2 Answers 2

Reset to default 2

Facebook 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./

Post a comment

comment list (0)

  1. No comments so far