Friday, February 15, 2013

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

I am making an app in which i am trying to get Notifications for Upcoming Facebook Friends Birthdays in Android

please someone help me on this, i have made everything i needed and now just want to add Notification functionality for upcoming birthdays.

       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

whitney houston autopsy results obama trayvon jim yong kim michael bush the host trailer whitney houston cause of death marquette university

No comments:

Post a Comment

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