3. Android Program Generation steps

Source: Internet
Author: User

  The main process is as follows:
 
List of required tools
Name function Introduction Paths in the operating system
Aapt Android Resource Packaging Tool ${android_sdk_home}/platform-tools/appt
Aidl Android Interface Description Language tools for converting to. java files ${android_sdk_home}/platform-tools/aidl
Javac Java Compiler ${jdk_home}/javac or/usr/bin/javac
Dex Convert. class files to. dex files that Davik VMs can identify ${android_sdk_home}/platform-tools/dx
Apkbuilder Build APK Package ${android_sdk_home}/tools/opkbuilder
Jarsigner Signing tool for. jar files ${jdk_home}/jarsigner or/usr/bin/jarsigner
Zipalign Byte-code alignment tool ${android_sdk_home}/tools/zipalign
   First Step: Package resource file, generate R.java file "input" resource file (that is, file in res in project),               Assets file (equivalent to another resource, this resource is not optimized for Android like files in Res),               Androidmanifest.xml file (the package name is read from here, because the build R.java file requires the package name), the Android base Class library (Android.jar file) "Output" Packaged resources (typically in the Android Project bin directory you can see a file called Resources.ap_),               R.java file (in the Gen directory, you should be familiar with) "Tools" AAPT tool, its path in ${android_sdk_home}/platform-tools/aapt            (if you are using a Windows system, the customary path should be written like this:%android_sdk_home%\platform-tools\aapt.exe, same as below).   Second step: Process the Aidl file, generate the corresponding. java files (of course, there are many projects do not use AIDL, then this process can be saved) "input" source files, aidl files, framework.aidl file "output" corresponding to the. java file "Tools" Aidl Tools   Step three: Compile the Java file and generate the corresponding. class file "input" source files (including R.java and aidl generated. java files), library files (. jar files), Output. class file Tools Javac Tools   Fourth step: Convert. class files to. dex files supported by the Davik VM input. class file (including Aidl. class file, R generated. class file, source file generated. class files), library file (. jar file) Output the. dex File tool Javac tools   Fifth step: Package generate unsigned. apk file "Enter" the packaged resource file, the packaged class file (. dex file), the Libs file (including the. So file, of course,Multi-project does not have such a file, if you do not develop with C + +) "Output" unsigned. apk file "Tools" Apkbuilder tools   Sixth step: sign unsigned. apk file "Enter" unsigned. apk file "Output" signed. apk file " Tool "jarsigner  Seventh step: Align the signed. apk file (no alignment is not posted to Google Market) after the" input "signature of the. apk file" output "aligned with the. apk file" Tools "zipalign tool   Knowing these details, we can implement a lot of things we want to implement, such as: automation, we can use some kind of script, like the batch processing under Windows, Bash,java under Linux, Ant,python, Perl and other scripting languages, Even the strongly typed languages of Java and. NET are also available. If you really understand the steps above and understand the nature of the process of compiling the package, you can automate it in any way you want, which is the real "extrapolate, Status quo". For example, the streamlining of the Android SDK, you know, now the Android SDK hundreds of trillion, we can fully apply the above knowledge, only the necessary tools to keep the SDK reduced to 10M below. Of course, there are plenty of things to do. From for notes (Wiz)

3. Android Program Generation steps

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.