I would like to read contacts from ContactsContract API which belongs only to Phone / SIM and would like to avoid contacts synced from other apps like facebook and gmail. I
I solved this problem.
Account[] accountList = AccountManager.get(this).getAccounts();
String accountSelection = "";
for(int i = 0 ; i < accountList.length ; i++) {
if(accountSelection.length() != 0)
accountSelection = accountSelection + " AND ";
accountSelection = accountSelection + ContactsContract.Groups.ACCOUNT_TYPE + " != '" + accountList[i].type + "'";
}