by Fran T
Version 1 (May 13, 2025)
Download (15 downloads)
Demonstrates getting all of the phone numbers and their types (Mobile, Work, etc.) for a contact, and also how to perform a reverse phone number lookup to get its type and the name of the contact associated with it. Phone number information is returned in both its raw form from the phone contact list, as well as its normalized E164 representation to facilitate their comparison.
For demonstration purposes, the relevant content queries are performed in subroutines to make them easier to identify and extract to use in your own flow. Simply copy the contents of the contact URI or phone number Subroutines at blocks 10 and/or 34, and the Variable Set block for the phoneNumberTypes dictionary preceding them.
At the end of flow, you can indicate whether you'd like all of the Android content field names and values to be logged to facilitate exploration of the API. For a contact query, a row of content is returned by the Android API for each type of data possessed by the contact, indicated in its mimetype field.
See:
https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Phone