I am writing a Facebook Android application in which I am trying to get a list of all upcoming facebook friends' birthdays, and I can get it.
But I ran into a problem, I only collect a list of friends until the end of December for this year, not all coming , like today, March 15, so I want to get a list of facebook friends who are born today, until March 14, but I get today until 31 December.
See the code below and help me solve this little problem:
Calendar cal = Calendar.getInstance();
Date today = cal.getTime();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd");
String today_formatted = formatter.format(today);
String query = "select name, birthday, uid, pic_square FROM user " +
"WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me()) AND birthday_date != 'null' " +
"AND birthday_date >= '" + today_formatted + "'ORDER BY birthday_date ASC";
source
share