Contact Editor

VN:RO [1.9.22_1171]
Rating: 5.0/5 (5 votes cast)
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

Contact Editor, 5.0 out of 5 based on 5 ratings

25 Customer Comments

Rate This Item »
  1. vaibhav Reply
    27, March 2012, 9:38am

    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();

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. memeller Reply
    27, March 2012, 10:48am

    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

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  3. vaibhav Reply
    27, March 2012, 12:24pm

    Thanks alot Works perfect !!

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  4. vaibhav Reply
    30, March 2012, 8:53am

    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

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  5. memeller Reply
    31, March 2012, 3:45pm

    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.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  6. kingert Reply
    06, April 2012, 1:03pm

    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

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  7. Mateusz Maćkowiak Reply
    06, April 2012, 4:15pm

    I’m sorry, in the last update on Android test forgot this. Add to Your manifest:

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  8. Mateusz Maćkowiak Reply
    06, April 2012, 4:58pm

    Ehh.. it cancled part of my post. Add to the manifest “activite” there is an update on github.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  9. Renu Reply
    20, April 2012, 5:36am

    Hi Memmler,

    Good job. Just wondering how to get contact photos in android platform.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  10. Rahul Joshi Reply
    20, April 2012, 11:14am

    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?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  11. PeterP Reply
    26, April 2012, 9:05am

    Nice Work and you can compile it on windows.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  12. memeller Reply
    30, April 2012, 7:17am

    @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.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  13. Christian Reply
    23, August 2012, 10:15am

    Just wanted to say thanks – this extension really helped me out :)

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  14. Ben74 Reply
    06, September 2012, 11:54am

    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.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  15. Anto Reply
    01, October 2012, 8:15pm

    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??

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  16. Frank Reply
    11, October 2012, 12:33pm

    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.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • shahzad Reply
      05, February 2013, 6:01am

      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?

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  17. Wayne Reply
    15, October 2012, 10:32pm

    Fantastic work!

    Got this up and running on my Flash CS6 iOS app in 5 mins!

    Hats off to you sir!

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • shahzad Reply
      05, February 2013, 5:56am

      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?

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  18. Wayne Reply
    15, October 2012, 10:33pm

    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…)

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  19. Rares Reply
    16, October 2012, 11:34am

    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 ?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  20. David Reply
    30, January 2013, 8:39pm

    Hey guys I am wondering how to install this into adobe flash cs5.5?

    Let me know – David

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  21. shahzad Reply
    03, February 2013, 11:02am

    ITs working for Andoid but for I phone the following error comes during pakcaging
    “Error occurred while packaging the application”

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  22. Alex Reply
    04, March 2013, 2:56am

    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.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  23. Alex Reply
    06, March 2013, 10:01pm

    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.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Write A Comment

Rate This Item