With READ_CONTACTS permission in your manifest, you can get synchronized contacts based on the type of account. For WhatsApp, this is "com.whatsapp" . So:
Cursor c = getContentResolver().query( RawContacts.CONTENT_URI, new String[] { RawContacts.CONTACT_ID, RawContacts.DISPLAY_NAME_PRIMARY }, RawContacts.ACCOUNT_TYPE + "= ?", new String[] { "com.whatsapp" }, null); ArrayList<String> myWhatsappContacts = new ArrayList<String>(); int contactNameColumn = c.getColumnIndex(RawContacts.DISPLAY_NAME_PRIMARY); while (c.moveToNext()) {
matiash
source share