The purpose of ANE and the place to be noticed on the Android platform

Source: Internet
Author: User

Flash is a cross-platform, although the current use of flash development hand-tour companies are relatively small, but also exist. At present, the general hand tour with COCOS2DX More, 3d hand tour is generally used Unity3d. Before the transformation of the company to do webgame, technology transformation is also a problem, so the basic will be able to use the existing technology system on the adoption, will not simply transformation with the mainstream. Used to do webgame, using Flash or very much, so the transformation of the hand after the tour will also basically use flash development hand tour, there will be no problem, in addition to a very small number of compatibility problems, basically no other problem, said Flash performance is poor, but do general, not very complex game enough And does not cause problems with performance issues. Hand tour often to work with third-party platform, so generally also need to take the third-party platform to provide SDK,SDK features are generally login, registration, payment, plus some other statistics. Flash development of the hand tour can be packaged into APK and IPA running on Android and iOS, when the SDK needs to be connected to the Android and iOS SDK, all through the ANE to complete.

ANE is an abbreviation for Adobe Air Native extension, the local extension of air, where AS3 cannot directly invoke the interfaces and methods of the system platform, and the role of ANE can be understood as a bridge between the Flash AS3 and the Local System interface method, The purpose of invoking the local interface method is to encapsulate some methods that call the local interface through the ANE, and then call the interface method in the AS3.

Here is not a detailed description of the development of the specific code and process of ANE, just a simple explanation of the ANE, you can quickly understand what ANE is, what is the use, and need to pay attention to the place.

Here are some of the issues I encountered during the development of the Android ANE:

1, the overseas platform generally provides the SDK has 2 projects: the platform's own SDK and the Facebook SDK (or the Google Play Service SDK), the experience of the platform side of its own SDK is the dynamic access to resources, Not by r.xx.xx, so we don't have to deal with the mapping of resources in the ANE, but the Facebook SDK or Google Play service The SDK is through the r.xx.xx to obtain resources, we need to manually remap the resources in the ANE again, or into the ANE package (*.ane) after the Flash project will not be able to find the resources to prevent the Flash project cannot be packaged, the reason for the lack of resources is flash When the mobile project is packaged, it automatically generates a air.xx.xxx .... The package name at the beginning. The method of mapping resources here is simple:

    • You can copy your own ANE Android project from your Facebook or Google Play Service SDK jar package, and then view the package name of the R file in your Facebook or Google Play Service SDK, in your own ane Under the SRC package of Android project, create a consistent package name, copy the R file to the package directory, remove the final modifier from the R.java so that the values in R can be modified and all the resource IDs in R will be re-assigned. Through the Frecontext.getresouceid ("xx.xx"), specifically how to engage Baidu under.
    • Some SDKs contain. So files and need to put the. So file in the specified directory according to the official instructions, but I encountered a strange problem, after joining the. so file into *.ane, and then the ANE reference into the Flash Project APK package cannot be installed, We need to find a signature tool to re-sign the APK, the exact reason is unknown, there may be other ways to solve it, but I finally succeeded by re-signing.
    • Overseas platform generally provided by the SDK has 2 Android projects, we need to manually merge the resources of the 2 projects into one, and finally put the merged Res folder into the specified directory down to generate ANE, Usually the same name files such as strings.xml need to manually merge the content, other non-duplicate files can be copied directly.
Android Ane that's it, there's nothing wrong with these basics. iOS ane is much simpler, I have not done iOS ane, but colleagues as long as the basic divert, but do Android ane divert will let you get unexpected error, anyway I was tossing a long time to do Android ane.

Then there is time for the specific steps of Android ane to be recorded in detail, and may be in contact after n years. However, I believe that Adobe Flash will also slowly solve the development of the cumbersome complex of the ANE case, then may do ane will not have so many pits father hang Niang pit all kinds of inexplicable problems.

The purpose of ANE and the place to be noticed on the Android platform

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.