Contact Editor
Rate This Item »ow for iOS and Android
author: memeller@gmail.com & Mateusz Maćkowiak (https://github.com/mateuszmackowiak) Currently supported:
- (NEW) pickContact – shows system contact picker, that enables user to select desired contact from list. After selecting the picker is dismissed, and the selected recordId is sent using ContactEditorEvent.CONTACT_SELECTED
- getContactCount – gets the number of contacts in AddressBook
- getContacts – gets contacts from AddressBook (name, lastname, compositename, phones, emails, recordid, birthdate)
- addcontact – adds contact to AddressBook
- removeContact – removes contact with specified recordId
- isSupported – returns if ane is supported on current platform, added on request from Mateusz
added after feedback from Mateusz(https://github.com/mateuszmackowiak) - getContactsSimple – gets contacts from AddressBook(compositename, recordid), shoud be faster than getContacts, because it requires less processing.
- getContactDetails – gets details for specified contact
Mateusz added implementation for Android platform and cleaned up some mess i left in files, so big thanks to him for his work!
As always android requires manifests. Just for accessing contacts informations:
< uses-permission android:name="android.permission.READ_CONTACTS" />
But more if Your app is going to add or remove any info:
< uses-permission android:name="android.permission.WRITE_CONTACTS" /> #only if adding: < uses-permission android:name="android.permission.GET_ACCOUNTS" />
ANE compilation
To compile the ane, osx widh iOS SDK is needed. This ane uses AddressBook framework, which has to be linked during the compilation (sample ane build.sh is provided in build directory, it already includes the link to AddressBook framework).
Not much, but still better than accesing the sql database directly
Tested on iPad, iOS 5.01 / Andorid 3.1



I have a windows 7 system and want to use the ane i included the ane in the program as well as the swf but i cannot get the options such as ContactEditor.getContactsSimple();
You should check the sample project, that is included with this extension.
To use the extension, add the .ane file to ‘native extensions’ and the .swc file to ‘library path’ under “Flex Build Path” in project properties. You should then be able to use the extension by creating a new object ( var contactEditor:ContactEditor=new ContactEditor()) and calling functions (like contactEditor.getContactsSimple()). You have to keep in mind, that address book functionalities are supported only in iOS and Android, so if you are trying this on windows or mac, you will not be able to use any functions other than isSupported(), which should return false when using it on an unsupported platform.
Current version is available at https://github.com/memeller/ContactEditor
Thanks alot Works perfect !!
i wanted to use contactEditor.showcontactdetailsinwindow() , but somehow when i write this it does not give an error but in the present view nothing is shown ,correct me if im wrong as it is void we just have to write contactEditor.showcontactdetailsinwundow().
i am a newbie with flex
no. link the swc file and read the documentation – you have to specify the recrordId of a contact to show its details. If you don’t, there is no data to display, so the window is not shown.
Hi memeller, thanks for your job. I download your test app for android.
I’m on Windows 7 and when i run the app in samsung galaxy all works fine except “pick contact”. when i click the button, it throws a native error : “android.content.activityNotFoundException, Unable to find explicit activity class”.
This error occurs when pickContact class tries to call the PickContentHandlerActivity.
any suggestion?
thanks
regards
I’m sorry, in the last update on Android test forgot this. Add to Your manifest:
Ehh.. it cancled part of my post. Add to the manifest “activite” there is an update on github.
Hi Memmler,
Good job. Just wondering how to get contact photos in android platform.
Hi,
I am using this ANE, rather first time working with an ANE. When exporting for release build, I get a message: This ANE is not used in the application…. But I am using the ANE in the app. I have added it in the project and also added the extension entry in the app.xml. Any other change I need to make?
Nice Work and you can compile it on windows.
@Renu – would love to help, but unfortunatelly i don’t have much experience with Android programming, i’ve only done the ios part
@Rahul Joshi – i’ve seen this a couple of times, some kind of flash builder thing with detecting the usage of an ane. Does the ane work in release build work despite this information?
@PeterP – it was possible from the start, the info about compiling the ane on ios is only about creating the .ane file after making some changes in the code. If you are just using it in your app without any changes, then it should compile in flash builder on osx and windows without problems, since it does not require linking to ios sdk.
Just wanted to say thanks – this extension really helped me out
Thank you for this ANE.
I’ve integrated it in a mobile application running on Adobe Air 3.3.
All API methods are working pretty on iOS well but this one: contactEditor.getContacts().
This last causes my application to crash…
My address book contains about 200 entries. Any ideas regarding this issue?
Regards.
Hey Guys, good job with the ANE. It seems like there is a problem with the new facebook linked contacts. Everytime you like an iphone with IOS6 and the latest Facebook. The application crashes… any fix in sight??
Hi,
very great extension, it works very well.
I have a question: I need the possibility to select only one of all phone numbers of a contact. the contact picker works great, but I have to read all numbers and make a second selector by my own. It would be great for the user experience if the user could select the contact and from contact detail view the phone number.
How you did it? It’a running in my Android device but not on IPhone 4s. It gives packaging error….Am I missing anything? Kindly explain the steps to use this extension….
What to do with ContactEditor.swc and ane build.sh?
Fantastic work!
Got this up and running on my Flash CS6 iOS app in 5 mins!
Hats off to you sir!
How you did it? It’a running in my Android device but not on IPhone 4s. It gives packaging error….Am I missing anything? Kindly explain the steps to use this extension….
What to do with ContactEditor.swc and ane build.sh?
Fantastic work!
Got this up and running on my Flash CS6 iOS app in 5 mins!
Hats off to you sir!
(forgot to 5* it…)
hey! awesome extension and i’vd been using it for a while. problem is that on IOS 6 it doesn’t return the contact names. Any clue on what i could do ?
Hey guys I am wondering how to install this into adobe flash cs5.5?
Let me know – David
ITs working for Andoid but for I phone the following error comes during pakcaging
“Error occurred while packaging the application”
I have pickContact working perfectly well on my iPhone but for some reason getContacts() returns null. Im checking for hasPermission() before calling getContacts() so I know the problem is not about having access to the contacts. Any reason why it might do this?
Just fyi: when I change getContacts() to pickContact() it works perfectly and I can getContactDetails() for the selected contact.
Been trying to debug this for a while, so any help would be great. Thanks in advance.
On taking a closer look at the Xcode project I realized that getContacts() is not actually implemented. For now Im using getContactsSimple() and then calling getContactDetails() for each recordId returned. As you might expect this slows things down a lot and my app freezes while this process is running.
Im playing around with the Xcode project now to see how I can do this natively so its faster.