android read contacts details using ContactsContract
<p>i am querying contacts through</p>

<pre><code>private Cursor cursor;
private static final String SORT_ORDER = ContactsContract.Contacts.DISPLAY_NAME + " ASC ";

String[]   myProjection = new String[] { ContactsContract.Contacts._ID, 
            ContactsContract.Contacts.DISPLAY_NAME, 
            ContactsContract.Contacts.PHOTO_ID,
            ContactsContract.Contacts.HAS_PHONE_NUMBER,
            ContactsContract.Contacts.STARRED};

cursor = managedQuery(ContactsContract.Contacts.CONTENT_URI, myProjection, null, null, SORT_ORDER);
</code></pre>

<p>and its giving me all contacts details.But my issue is with the duplicate contact details.
Like i am getting a few contacts details multiple times. i think one is from my phone contact another is from facebook contact and from other sites as well.How can i show only one contact of same person in my details.</p>

<p>i have read in some blogs stating a different projection like</p>

<pre><code>ContactsContract.Contacts.Data.RAW_CONTACT_ID
</code></pre>

<p>and different URI</p>

<pre><code>RawContacts.CONTENT_URI
</code></pre>

<p>Can anyone suggest me what is the diff between the two URI.i need to query id,name,photo,phone number,email,starred.</p>

<p>Thanks</p>
