I see from this post (http://www.mail-archive.com/android-
[email protected]/msg68933.html) that due to a facebook
policy decision that facebook account data such as contact photo can't
be accessed via the api. For my app's purposes, that's fine, but it
seems to be causing me pains getting back a cursor that contains only
contacts with "truly accessible" contact photos. An example usage for
such a query would be to present a scrollable gallery of contacts that
have contact images (including a result count).

Here's my query to get all users with a photo:

        Uri uri = ContactsContract.Contacts.CONTENT_URI;
        String[] projection = new String[]{
                ContactsContract.Contacts._ID,
                ContactsContract.Contacts.DISPLAY_NAME,
        };
        String selection = ContactsContract.Contacts.PHOTO_ID + " !=
'0'";

The problem is that the result of that query contains contacts that
are aggregate google/facebook contacts, but where the google account
contact doesn't have a photo.

For such aggregate contacts, when I load the photo, it comes back
null:
        Uri uri =
ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, id);
        InputStream input =
ContactsContract.Contacts.openContactPhotoInputStream(cr, uri);

Is there another way to achieve the result I'm looking for, without
having to go one by one through each returned contact, which would be
fairly inefficient?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to