Saturday, February 16, 2013

How do I show Notification for UpComing Facebook Friends Birthdays in Android

I am writing an app in which i am getting List of Friends in form of January to December as you can see in screen shot

Now i want to show in form of Upcoming Facebook Friends Birthdays by using current date...please someone help me...

Like in below image you can see i am getting friends on top, those birthdays has gone away, but still i am getting on top, so i just want to show list in form of Upcoming birthdays

enter image description here

       public View getView(int position, View convertView, ViewGroup parent)      {         JSONObject jsonObject = null;         try          {             jsonObject = jsonArray.getJSONObject(position);         } catch (JSONException e) {          }          FriendItem friendItem;         if (convertView == null) {             convertView = mInflater.inflate(R.layout.listfb_friends, null);             friendItem = new FriendItem();             convertView.setTag(friendItem);         } else          {             friendItem = (FriendItem) convertView.getTag();         }          friendItem.friendPicture = (ImageView) convertView                 .findViewById(R.id.picture);         friendItem.friendName = (TextView) convertView                 .findViewById(R.id.name);         friendItem.friendDob = (TextView) convertView                 .findViewById(R.id.dob);         friendItem.friendLayout = (RelativeLayout) convertView                 .findViewById(R.id.friend_item);          try          {             String uid = jsonObject.getString("uid");             String url = jsonObject.getString("pic_square");             friendItem.friendPicture.setImageBitmap(picturesGatherer.getPicture(uid, url));         } catch (JSONException e)          {             friendItem.friendName.setText("");             friendItem.friendDob.setText("Birthday Not Mentioned");         }          try          {             friendItem.friendName.setText(jsonObject.getString("name"));             friendItem.friendDob.setText(jsonObject.getString("birthday"));              if(!(jsonObject.getString("birthday").equalsIgnoreCase("null")))             {             friendItem.friendDob.setText(jsonObject.getString("birthday"));             }             else             {             friendItem.friendDob.setText("Birthday Not Added");             }          } catch (JSONException e)          {             friendItem.friendName.setText("");             friendItem.friendDob.setText("");         }         listofshit.put(position, friendItem);         return convertView;     } 

Query to Fetch Records:

    String query = "SELECT name, birthday, uid, pic_square FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1=me())AND birthday_date >= '01/01' AND birthday_date <= '31/12' ORDER BY birthday_date"; 

original code you can find here:

https://github.com/chrtatu/FacebookFriendsList 

Source: http://stackoverflow.com/questions/14888546/how-do-i-show-notification-for-upcoming-facebook-friends-birthdays-in-android

watergate mlb pregnant man outside lands 2012 lineup beloved ufc results water for elephants

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.