"Suitable for reading" Before Air SDK 4.0, the students who will pack ane. If you have no experience before, can directly message the question, I will supple answer.
"Objective of this article": Air 4.0+, it is very effective to support the r* file mechanism. In short, you can reference resources without Getresourceid (), and you can use r.x.x to refer to resources directly in your Android program.
Installation
Air sdk:http://helpx.adobe.com/air/kb/archived-air-sdk-version.html (download 4.0+ version, including 4.0)
If you have a version below 4.0, the Update method is simple. Unzip directly, overwrite update D:\DevTools\Adobe Flash Builder 4.6\sdks\4.6.0 (This is my installation path). Note: The update is overwritten because this path also contains the Flex SDK.
"Key Analysis":
For supporting the r* file mechanism, the official website, very concise. Links: http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2e74ffb4130044f3619-7ff8.html
Here is a fairly well-developed tutorial: Http://jmsliu.com/2143/add-admob-ads-in-flash-based-android-apps.html#androidjar
The above tutorial, speaking very detailed, there are steps, very clear.
Below, I'll only tell you a few details that are not in the tutorial:
First, the directory structure of packaging tools
Because my system is win7 (64 bit), so my packaging tools such as:
Note here 2 places:
1. Adt.jar is a packaging tool in Flash Builder 4.6, path: D:\DevTools\Adobe Flash Builder 4.6\sdks\4.6.0\lib, ensuring that the Air SDK 4.0+
2. Platform-android.xml, is a new addition before comparison. This has 2 functions, merging jar packages and generating r files corresponding to the library project.
Second, Android-arm
My local Project: Android Project, citing the Facebook SDK as a library project.
The above catalogue is divided into several parts:
1, put the resource file 2,java side corresponding as code 3,android Project 4,facebook SDK jar package 5, the remaining jar files, is the Android project all used Jar package.
Third, Platform-android.xml
<platform xmlns= "http://ns.adobe.com/air/extension/15.0" ><packagedDependencies>//placement except All dependent jar Packages <packagedDependency>android-support-v4.jar</packagedDependency> <packagedde outside of Java-as.jar Pendency>java-lib.jar</packageddependency> <packageddependency>alipay.jar</packageddependency > <packagedDependency>gson-2.1.jar</packagedDependency> <packageddependency>rekoosdk_0.4_80 80.jar</packageddependency> <packageddependency>sun.misc.base64decoder.jar</packageddependency > <packagedDependency>java-facebooksdk.jar</packagedDependency> <packagedDependency> Bolts-android-1.1.2.jar</packageddependency></packageddependencies> <packagedResources>// Library project corresponding package name and resource file name <packagedResource>//My Android Project project
<packageName>com.rksgame</packageName> <folderName>lib-res</folderName> </p ackagedresource> <packagedResource>//facebook SDK Library Engineering <packageName>com.facebook.android< /packagename> <folderName>fb-res</folderName> </packagedResource> </package Dresources></platform>
Note version: xmlns= "http://ns.adobe.com/air/extension/15.0" is consistent with your Adt.jar version. My version is 15.0
Iv. issues that are easily overlooked
Your own Android project and the referenced third-party library SDK are set to the IS library. This is a problem that is ignored in many tutorials. This big pit, troubled me a day, really is silent ...
This seems to be the point of improvement compared to the packing method before air 4.0. Measured, successful ...
If you have any other questions, you can send me a message or email to: [email protected].
Air 4.0+,ane Packaging considerations "for Android"