Display the app icon if the contact is associated with the application in phone address book

The following code shows a possible solution. Calling the synchronizeContact method will lead to adding the link in the contact app. Note it is not yet robust code but it shows the idea and is working. Note also the following two POJO classes are specific to my implementation and not essential to the working of … Read more

Provide the caller id for incoming call from my own app

I just barely wrote a tutorial on how to get this working. Check it out here: https://simplenexus.dev/2019/08/27/android-caller-id.html The basics of how to get this working are: AndroidManifest.xml <provider android:name=”.callerid.CallerIDProvider” android:authorities=”@string/callerid_authority” android:readPermission=”android.permission.READ_CONTACTS” android:enabled=”true” android:exported=”true”> <meta-data android:name=”android.content.ContactDirectory” android:value=”true”/></provider> CallerIDProvider.kt private var userRepository: UserRepository? = null private val uriMatcher = UriMatcher(UriMatcher.NO_MATCH) override fun onCreate(): Boolean { context?.let { … Read more

Taking contact list from hotmail gmail yahoo in java? [closed]

Each of these email providers has its own API: GMail: Google Contacts Data API – Google Contacts API version 3.0 Yahoo! Mail: Yahoo! Address Book API – Developer’s Guide Hotmail: Windows Live Contacts API Beta – API Reference There are usually Java samples that you can use to start your work. I’ve been using Google … Read more

Android contacts Display Name and Phone Number(s) in single database query?

Try this code: Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI; String[] projection = new String[] {ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER}; Cursor people = getContentResolver().query(uri, projection, null, null, null); int indexName = people.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); int indexNumber = people.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); if(people.moveToFirst()) { do { String name = people.getString(indexName); String number = people.getString(indexNumber); // Do work… } while (people.moveToNext()); }

How to fetch all contacts record in iOS 9 using Contacts Framework

Both other answers do only load contacts from the container with the defaultContainerIdentifier. In a scenario, where the user has more than one container (i.e. an Exchange and an iCloud account which both are used to store contacts), this would only load the contacts from the account that is configured as the default. Therefore, it … Read more

Retrieve all contacts phone numbers in iOS

Try this it works for iOS 6 as well as iOS 5.0 or older: Sample Project Demo First add the following frameworks in Link Binary With Libraries AddressBookUI.framework AddressBook.framework Then Import #import <AddressBook/ABAddressBook.h> #import <AddressBookUI/AddressBookUI.h> Then use the following code Requesting permission to access address book ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, NULL); __block BOOL accessGranted = … Read more

How to obtain all details of a contact in Android

Had to change a bit of the tutorial on Content Providers since it referenced deprecated classes, this might help. import android.provider.ContactsContract.Contacts; import android.database.Cursor; // Form an array specifying which columns to return, you can add more. String[] projection = new String[] { ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone ContactsContract.CommonDataKinds.Email }; Uri contacts = ContactsContract.Contacts.CONTENT_LOOKUP_URI; // id of the Contact … Read more

get contact info from android contact picker

Phone Numbers Phone numbers are stored in their own table and need to be queried separately. To query the phone number table use the URI stored in the SDK variable ContactsContract.CommonDataKinds.Phone.CONTENT_URI. Use a WHERE conditional to get the phone numbers for the specified contact. if (Integer.parseInt(cur.getString( cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) { Cursor pCur = cr.query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, … Read more

Read all contacts’ phone numbers in android

Following code shows an easy way to read all phone numbers and names: Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,null,null, null); while (phones.moveToNext()) { String name=phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME)); String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); } phones.close(); NOTE: getContentResolver is a method from the Activity context.

Programmatically Request Access to Contacts

As per this documentation on apple’s site (scroll down to Privacy in the middle of the page), access to the address book must be granted before it can be access programmatically. Here is what I ended up doing. #import <AddressBookUI/AddressBookUI.h> // Request authorization to Address Book ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) … Read more