最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论