In my application I try to syncronize the contacts of the Phonebook with the users from Firebase. Therefore I query all contacts from Phonebook with ContactsContract.CommonDataKinds.Phone.CONTENT_URI and iterate through them to check each number:
databaseUsers.orderByChild("mobilnumber").equalTo(phoneNumber).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
I think this is the worst solution but I have no idea how to solve this problem. If users have many contacts it takes a long time to syncronize with Firebase with my code... Can you tell me how to solve this problem more efficient?
Moreover I have another problem with some numbers because in the Logcat I am missing some saved contacts from my phonebook. The code to get the numbers is the following:
String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
Is something missing here to get ALL numbers? Thanks in advance!