守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 1155|回复: 0

访问编辑联系人ANE

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    52619
    钢镚
    1422

    开源英雄守望者

    发表于 2015-1-22 11:30:32 | 显示全部楼层 |阅读模式
    应用下载
    应用名称: ContactEditor
    支持64位:
    当前版本: 未知
    运行平台: IOS 
    开发语言: ActionScript 3 其他 
    应用类别: ANE-C/C++
    应用简介: Native Extension for iOS and Android enabling AddressBook access
    Contact Editor - AddressBook Native ExtensionThis project is no longer actively developed by its creator.

    I no longer work with iOS devices, so I am not able to test the extension on real devices. I have updated the project with recompiled .ane (AIR 14 and iOS 7.1 SDK), on Android 4.4 and iOS simulator everything runs ok. If anyone wants to continue our work, you are free to do so. Also this project is available under

    iOS and Android

    author: Paweł Meller & Mateusz Maćkowiak (https://github.com/mateuszmackowiak)

    Features:

    • iOS 6 support (info below)
    • setContactImage - sets new image used as contact photo
    • getContactBitmapData - returns bitmap data of image used as contact photo
    • addContactInWindow - shows native window for adding new contact
    • showContactDetailsInWindow - shows native window for viewing contact details. If 'isEditable' parameter is set to true, enables editing of contact details.
    • 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, addresses)
    • 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:

    1. < uses-permission android:name="android.permission.READ_CONTACTS" />
    复制代码
    But more if Your app is going to add or remove any info:

    1. < uses-permission android:name="android.permission.WRITE_CONTACTS" />
    2. #only if adding:
    3. < uses-permission android:name="android.permission.GET_ACCOUNTS" />
    复制代码
    To pick a contact it is necessary to ad also :

    1.   <application>
    2.             <activity android:name="pl.mateuszmackowiak.nativeANE.contactManager.PickContactHandler" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
    3.         </application>
    复制代码
    ANE compilationTo 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).Tested on iPad, iOS 5.01 / Andorid 3.1,4.032014: Tested on 7.1 simulator, Android 4.4iOS 6/7 supportAddressBook access was changed starting from iOS 6, unfortunatelly with no backwards compatibility. I've added the updated code under ios6 branch, i've only had a chance to test it under ios simulator, everything worked well. To compile, AIR 3.5 or later is needed (or earlier version with ios6 sdk linked using platformsdk switch or flash builder 4.7). The compilation works (if you get any errors connected with 'Undefined symbols for architecture armv7:' you have not included ios6 sdk or are not using AIR 3.5), and the ane should also work without problems. Since iOS 6 also brought some changes to presentModalViewController and dismissModalViewControllerAnimated these function calls were also updated. This branch removes the old 'getContacts' method, which is no longer supported (use getContactsSimple + getContactDetails), due to changes in permissions a new function (hasPermission) has been introduced to determine the status of permissions to use address book. Again - ios6 branch is experimental, it has not been yet fully tested on real devices running iOS 6 (Apple, why u not bring iOS 6 to older devices?), so it should not be used in production environment.LicenseThis project made available under the MIT License.Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.





    相关链接:
    https://github.com/memeller/ContactEditor
    https://github.com/freshplanet/ContactEditor

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2024-3-28 20:01 , Processed in 0.056039 second(s), 37 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表