Access Android Contacts With Firemonkey in Delphi XE5

Delphi XE5 Firemonkey Android ContactsI had this demo built to access the native Android contacts information. It accesses the name, phone number, and email address of all of the contacts in the user’s contacts list. Make sure that you set the contacts Read permission in the Android Manifest like so:

[/crayon]
Be sure to check out our demo on how to read the IOS contacts from an IOS device as well. If you implement both demos in your own app you will have a true cross platform Firemonkey application. The API for reading the contacts is it’s own non visual component so you should be able to easily incorporate it into your own application.

Download Delphi XE5 Firemonkey Android Contacts Manager Demo

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Access Android Contacts With Firemonkey in Delphi XE5 by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.

15 Responses to Access Android Contacts With Firemonkey in Delphi XE5

  1. Pingback: Access IOS Contacts With Firemonkey in Delphi XE5 | FMX Express

  2. Pingback: Accessing contacts from Delphi at iOS and Android | Pavel Jiri Strnad

  3. HI,

    you did great work, thank you!

    I took your code for Android and iOS and built from it one library that works at both mobiles.

    If you are interested, please download it from http://pjstrnad.com/files/ContactsManager.zip.

    Here is short blog about it: https://pjstrnad.com/accessing-contacts-delphi-ios-android/

    P/J

    • emmaus says:

      HI Pavel,

      I have to tried your unique library for the both mobiles in XE7 on android mobile and i just have a black screem. However the demo for access android work fine, have you and idea about the problem? So i can not found the last link about short blog.

      Emmanuel.

  4. Pingback: Access Device Contacts With Delphi XE5 Firemonkey On Android And IOS | Delphi XE5 Firemonkey, Delphi Android, Delphi IOS

  5. Cliff House says:

    I got this to work in XE5, but now I’m in XE6 and it’s giving me trouble. In the ContactsManager, it doesn’t like any of the StringToJString or JStringToString references. It also gave me this error

    “[DCC Error] ContactsManager.pas(132): E2250 There is no overloaded version of ‘query’ that can be called with these arguments”

    for this code

    “wCursor :=query(wUri,nil, nil,nil, StringToJString(‘display_name ASC’)); // Query to get all contact sorted by display name”

    Is there something I’m missing that’s different in XE6?

  6. h264 says:

    Hi,

    I want to edit the contacts on Android using XE6, but how???

    I tried to use JNI but JContentValues does not init on mobile! it gives an error!

    Please help
    Thanks

  7. Pingback: Access Calendar Events And Reminders In Delphi XE6 Firemonkey On Android | Delphi XE5 XE6 Firemonkey, Delphi Android, Delphi IOS

  8. emmaus says:

    Hey,

    I try it with XE7 and i am satisfied; good job

    Emmanuel

  9. Fernando says:

    How do I edit a contact?

  10. Noble says:

    Hi, am tried it with XE8 and it worked but it takes 2mins to display contacts on Android. Any way out of this for it to display in shorter time or what may be the problem.

    • Admin says:

      How many contacts are there? The demo looks like it uses the OnCreate even but you probably should not put code in there (the app will load faster). What you could do is load the contacts into a TStringList, TObjectList, or TMemTable and then use the data from that to display in your Delphi control. I’m using that the loading into the visual display may be where the slow down is unless you have 5000 contacts or something. It’s accessing the Android API so if it’s slow from Android itself not sure there is much you can do besides caching the data.

  11. Pingback: Access Device Contacts With This Free Library In #Delphi XE8 Firemonkey On Android And IOS | Delphi XE5 XE6 XE7 XE8 Firemonkey, Delphi Android, Delphi IOS

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
IOS Contacts Firemonkey Delphi XE5
Access IOS Contacts With Firemonkey in Delphi XE5

I had this demo built to allow reading from the IOS contacts using Delphi Firemonkey. It allows you to access...

Close