AIR Android: A simple AIR project

Source: Internet
Author: User

Practice: A simple AIR project

Start FD and click the Project> New Project command in the menu to create an AIR Mobile AS3 App Project, as shown in figure 1-11.

Click OK. The FD built-in Project template automatically creates all required files for us. On the Project panel on the right, you can see the Project structure, as shown in 1-12.

The related files shown in Figure 1-12 are described as follows:

Application. xml is a program Property setting file.

PackageApp. bat is the batch processing script of the publisher, which is used to package and generate the final APK file.

Run. bat is a script for debugging and running programs.

The bat directory contains several major program configuration scripts, including CreateCertificate. bat used to create the p12 authentication file and SetupApplication. bat used to set project parameters.

The icons directory stores Icon files.

The src directory is the program source code directory, where Main. as is the Main program by default.

Air_android_readme.txtand air_ios_readme.txt are help files that describe the development and debugging of Android and iOS projects respectively.

 
Figure 1-11 use FD to create an AIR Android Project
 
Figure 1-12 FD project structure

After the project is created, you can prepare the release program. The automatically generated Main class does not contain any content, but does not affect the test.

You must compile and generate the SWF file before publishing. Click Project> Build Project in the menu. You can also use the shortcut key F8. After compiling the SWF file, right-click the packageApp. bat file and select Execute from the shortcut menu to run the script to generate the APK file. If it is the first release, you also need to create a signature certificate. Run bat/CreateCertificate. bat in the file system to generate a p12 format file. The default password of the certificate is fd, which is stored in the cert Directory. To change the password, edit the corresponding values in the bat/SetupApplication. bat file and recreate the signature certificate. FD provides multiple options when executing the publish script, as shown in figure 1-13.

 
Click to view the larger image) Figure 1-13 options for release

The first three items are for the Android platform, and the others are for the iOS platform. The options are described as follows.

Normal: generate the APK file, excluding the debugging function.

Debug: generate an APK file with the debugging function.

Captive: bind the AIR runtime so that files can run directly without relying on the AIR runtime.

Fast test: uses the interpreter mode to quickly compile the running version of the test, excluding the debugging function.

Fast debug: uses the interpreter mode to quickly compile the debugging version for testing.

Slow test: Compile the running version of the test in normal mode.

Slow debug: use the normal mode to compile the test version for testing.

Ad-hoc: Create an application version for temporary deployment.

App Store: Create a final version for deployment to the Apple App Store.

When you publish a program, enter the corresponding number to create the corresponding program version. From this point of view, the FD project template is very simple and can solve all problems with one click.

It is prompted that the interpreter compilation mode is a new feature after AIR 2.7. It is not recommended to release the official version to solve the problem that the program release takes too long during debugging on the iOS platform.

Enter the number 1 and press enter to package the script. You will find that there is a dist folder in the directory, which is the final APK file to be released.

Related Article

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.