try {
HttpServletRequest request = getRequest();
HttpSession session = request.getSession(true);
String sessionKey = (String) session
.getAttribute(FacebookUtil.SESSION_KEY);
FacebookJsonRestClient client = new FacebookJsonRestClient(
FacebookUtil.API_KEY, FacebookUtil.SECRET_KEY,
sessionKey);
FacebookContact facebookUser = null;
Long uid = client.users_getLoggedInUser();
if (uid != null) {
facebookUser = new FacebookContact();
facebookUser.setUserId(uid);
/*
* json ile
*/
Vector<Long> userIds = new Vector<Long>();
/*
* Kendi Bilgilerinide alcaz
*/
userIds.add(uid);
/*
* Kullan�c� Arkadas idlerini alcaz
*/
JSONArray friendsId = client.friends_get();
for (int i = 0; i < friendsId.length(); i++) {
Long obje = friendsId.getLong(i);
userIds.add(obje);
}
/*
* Ki�i bilgilerini al
*/
JSONArray friendsDetail = client.users_getInfo(userIds,
FacebookUtil.fields);
List<FacebookContact> contacts = new ArrayList<FacebookContact>();
for (int i = 0; i < friendsDetail.length(); i++) {
JSONObject obje = friendsDetail.getJSONObject(i);
FacebookContact contact = new FacebookContact();