To answer my own post... I looked at the Contacts source code, and
this is essentially what they do:

The main "My contacts" group is called
Contacts.Groups.GROUP_MY_CONTACTS.
To query all members in that group, simply use this URI:

Uri uri = Uri.parse("content://contacts/groups/system_id/" +
Contacts.Groups.GROUP_MY_CONTACTS + "/members");

Works like a charm for me. I can imagine that at least part of this
URL is contained in the Contacts.Groups.CONTENT_* strings, so it would
be cleaner to use those.

-Mike



On Mar 18, 11:39 pm, EboMike <[email protected]> wrote:
> I have the same problem, but I need a better solution. I'm doing a
> managed query on thecontactsand am already filtering out entries
> that do not have a DISPLAY_NAME, but I still get all the suggestedcontacts. I 
> need to deal withcontactsthat have a name but no phone
> number or email address.
>
> I guess the proper way would be to check in which group a contact is,
> but what's the quickest way to do that in a simple managed query? And
> what group is the official "Contacts" group?
>
> I could look at the source for thecontactsapp, but maybe there is
> "an official" solution that someone could post here real quick.
>
> On Feb 14, 1:51 pm, Chili <[email protected]> wrote:
>
> > Hey Miguel,
>
> > I was having the same problem. It's not a perfect solution but you can
> > check whether the contact has a name and/or phone number and if not
> > add then don't add them to your list. Just loop through all the items
> > and add items to a List<> and then use the List<> to populate you
> > listview.
>
> > Chili
>
> > On Jan 27, 5:06 am, Miguel Paraz <[email protected]> wrote:
>
> > > On Dec 9 2008, 8:22 am, Paul <[email protected]> wrote:
>
> > > > bklik's question seemed to indicate that he was dumping the contact
> > > > list programactically via his own activity.  I was just wondering if
> > > > thecontactsAPI was returning allcontactsand the activity needed to
> > > > do the filtering.
>
> > > I have the same situation.
> > > I use the contact list content provider to let the user select an
> > > email address.
> > > The SuggestedContactsare irrelevant to my application and just slow
> > > down the loading process.
>
> > > I looked at the SQLite db using the sqlite command line, but couldn't
> > > find how to differentiate thesecontacts.
> > > Is there a way?
>
>
--~--~---------~--~----~------------~-------~--~----~
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