Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess the internal addressbook
    primarykey
    data
    text
    <p>For more than two days now, I'm trying to grab a list of all contacts, from the internal addressbook (no facebook-, gmail- or twittercontacts) with their family- and givenname.</p> <p>I managed to get a list with all contacts, socialcontacts included. So I looked at the account_types and saw that on my HTC Desire all the internal addressbook-contacts were from "com.htc.android.pcsc" and I was like "Great, I just have to filter the whole list". But then all people with non-htc android cellphones would be unable to use my app, if I would hardcode this filter.</p> <p>Next idea was to let the user choose which account he wants to use, but unfortunately the "com.htc.android.pcsc" didn't appear in the list I got from the AccountManager?!?</p> <p>So my question is: Is there any standardized way to access the internal adressbook? I'm really stuck with that and any hint is highly appreciated!</p> <p><strong>/edit:</strong> Maybe i didn't make my self clear enough. I <em>can</em> grab a contactlist, via the ContactsContract API:</p> <pre><code>ArrayList phoneContacts = new ArrayList(); String[] projection = new String[] { Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME, ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME }; String selection = Data.MIMETYPE+" = '"+ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE+"'"; Cursor cursor = getContentResolver().query(ContactsContract.Data.CONTENT_URI, projection, selection, null, null); while (cursor.moveToNext()) { phoneContacts.add(...); } cursor.close();</code></pre> <p>But then I have contacts from all the different accounttypes, like com.google / com.htc.socialnetwoork.facebook, etc.</p> <p>And my question is: How can I filter all these socialnetwork- and gmailcontacts out, so I have a list with contacts, which are only from my internal addressbook?</p> <p><strong>/edit2:</strong> I found an example which describe the same difficulty I have: <a href="http://forum.synthesis.ch/showthread.php?t=2057" rel="nofollow">http://forum.synthesis.ch/showthread.php?t=2057</a> Synthesis AG had the same problem with their SyncML, that people complaining that they can't sync with their internal addressbook/phonebook only with gmail, facebook, etc. But they managed to seperate the internal addressbook from all these other accounttypes. So there must be a way to solve this problem, but I can't figure out how. Please help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload