Android 中的当月 Facebook 好友生日 [英] Current Month Facebook Friends Birthdays in Android

查看:22
本文介绍了Android 中的当月 Facebook 好友生日的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,在该应用程序中,我使用 Hackbook 示例代码 获取 Facebook 好友 列表,但现在我想获取那些生日的 Facebook 好友列表在本月,获取我正在使用此代码的所有朋友的列表:

I am writing an app in which i am fetching list of Facebook Friends using Hackbook Sample Code but now i want to fetch list of Facebook Friends those birthdays in Current Month, to get list of all Friends i am using this code:

 public static void requestFriends(FacebookRequest facebookRequest) {
    Log.d(LOG_TAG, "requestFriends(" + ")");
    String query = "select name, birthday, uid, pic_square from user where uid in (select uid2 from friend where uid1=me()) order by birthday_date";
    Bundle params = new Bundle();
    params.putString("method", "fql.query");
    params.putString("query", query);
    FacebookUtility.asyncRunner.request(null, params, new FacebookRequestListener(FacebookRequestListener.FRIENDS, facebookRequest));
}

我仍然使用下面的代码来获取当月生日的朋友列表:

Still i am using below code to get List of Friends those Birthdays in Current Month:

 Calendar c = Calendar.getInstance(); 
    int month = c.get(Calendar.MONTH)+ 1;

    String query = "select name, birthday, uid, pic_square from user where uid in " +
    "(select uid2 from friend where uid1=me())AND birthday_date >= '" + month + "/01' AND birthday_date <= '" + month + "/31' ORDER BY birthday_date ASC";

但是我没有得到任何记录,我在哪里失踪了?

but i am not getting any record, where i am missing ?

推荐答案

使用此查询以升序获取当前月份的 facebook 好友..

Use this query to get the current months facebook friend in ascending order..

SELECT name,birthday, uid, pic_square FROM user WHERE uid in (SELECT uid2 FROMfriend WHERE uid1=me())ANDbirthday_date >= '01/01/2013' ANDbirthday_date <= '31/01/2013' ORDER BYbirth_date

这篇关于Android 中的当月 Facebook 好友生日的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆