Chapter 3. Social APIs

New Social APIs have been introduced with Android Ice Cream Sandwich and this API makes it easy to integrate social networks. Furthermore, high resolution photos could be used as contact photos after Android Ice Cream Sandwich was released. This chapter shows Social API usage with examples.

The topics covered in this chapter are as follows:

  • Basics of contacts in Android
  • Using the Social API

Basics of contacts in Android

A person may have multiple contact information details. In Android, these multiple contact information details are joined and displayed as one contact detail. For instance; a person may have a Google+ contact, a Skype contact, and a phone contact, and Android joins all these contacts into one contact. Each of these sources of contacts is RawContact. Each RawContact has one or more data row, which holds some data about the contact such as phone number, e-mail, and so on. Refer to the following block diagram for a better understanding of their relationship:

Basics of contacts in Android

Each RawContact has support for storing social network streams—texts and photos—with Android Ice Cream Sandwich. Each RawContact is associated with StreamItems which contains texts, timestamp, and comments from social media updates, such as Google+, and each StreamItem is associated with StreamItemPhotos which contains photos (such as photos in a Google+ post). However, there is a limit for the number of StreamItems stored in RawContact. This number can be fetched with a query with StreamItems.CONTENT_LIMIT_URI URI. When the number exceeds the limit, the stream item with the oldest time stamp is removed. The following block diagram depicts the relationship between these blocks:

Basics of contacts in Android
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
35.170.81.33