We think Liveshare is what modern communication should be, flexible, visual and instant. We are quickly converging toward our next-gen UI and interim are taking steps to substantially improve our current sign-up, sign-in, and invite flows. As part of this effort, we are stoked to reveal our spanking new Identity Service with the upcoming release of Liveshare across our mobile and web clients.
The new Identity Service will enable our millions of users to do two things: one, log in to Liveshare independent of Facebook connect (a constant barrier because of the lack of trust users have with new applications and also because of the lack of user request which makes successful invitations hard to achieve), and move beyond just their social graph for inviting friends to include their phone and email graph as well.
While an Identity Service is not a novel feature or an engineering marvel unto itself, our implementation, seamless invite flow, and fluid log in process is what we’re proud to be releasing soon.
In designing the invite flow, we wanted to present the user with a comprehensive list of contact information from which to choose and auto-complete their friend’s email and phone information. For Android’s implementation we took advantage of the Android Contacts Manager as it syncs with the user’s GMail account and gives access to a detailed contact list to present to the user. To separate out the phone contacts, there is a column provided called HAS_PHONE_NUMBER. A typical query to retrieve all contact IDs might look like the following:
// Get list of Contact IDs.
final String[] contactProjection = new String[] { Contacts._ID, Contacts.DISPLAY_NAME, Contacts.HAS_PHONE_NUMBER };
final Cursor contactsCursor = cr.query(Contacts.CONTENT_URI, contactProjection, null, null, null);
while (contactsCursor.moveToNext()) {
// We separate out those contacts with a phone number.
if (!contactsCursor.getString(HAS_PHONE_NUMBER_COLUMN).equals(”0″)) {
// Do work. #1
}
}
One approach would be to query for the phone number value for each contact ID as we cycle through them in the above snippet (#1). However, depending on the size of the contact list, this simplistic approach may result in hundreds of queries and prove inefficient in retrieving phone numbers. We found a better approach is to form a comma separated string of contact IDs and query for phone numbers for IDs that fall into that set using the SQL IN operator. The following snippet of code uses a String that contains a set of contact IDs for the query.
// String ids = “(a,b,c,g,j,l,…)”, a list of all Contact IDs.
final String[] PHONE_PROJECTION = new String[] { Phone.CONTACT_ID, Phone.NUMBER };
Cursor phoneCursor = cr.query( Phone.CONTENT_URI,
PHONE_PROJECTION,
Phone.CONTACT_ID + ” IN ” + ids,
null,
null);
The results are stored in phoneCursor which is a mapping of Contact IDs to phone numbers. We also used a similar approach for retrieving email addresses.
Unlike other platforms, Android gives us a head start in developing and deploying a feature-rich application through many examples such as the one above. Providing our users with the right contact graph from the get-go is invaluable for increased chances of success in an invite-based viral loop. We look forward to our users’ feedback and hope they love the simplified UI, the killer (Cooliris-developed) Gallery experience in Liveshare, and of course the powerful use-cases Liveshare enables.
While we are proud of this release and the easy ‘getting started’ flow, our subsequent releases will do even better as we try and bridge the login gap between the user and their content further.
Thanks!
*The new version is not yet live, but follow us on Twitter or Facebook to get the update when it becomes available.