Build Process and Package File Content
This chapter provides tutorial notes on the Android project build process. Topics include Android project folder structure; project build process; Ant automated build command; Android Asset Packaging Tool (aapt); Java compiler (javac); Dalvik Executable (dex) conversion; 'apkbuilder' command for packaging and signing; .apk package file content; digests and signature of .apk file.
"android create project" Command Options
Android Project Folder Structure
Android Application Project Build Process
Project Build Process Done by "ant debug" Command
Detailed Output of "ant -verbose debug" Command
Output of "ant -verbose debug" - Android SDK R17
"aapt" - Android Asset Packaging Tool
"aapt package" Command - Resource Code Generation
"javac" - Java Compilation Command
"dx.bat --dex" Command - Converting .class Files into .dex File
"apkbuilder" Command - Packaging and Signing .apk File
"zipalign" Command - Aligning File Locations in .apk Package
"aapt dump" Command - Printing Contents of .apk Package
META-INF Files - Digests, Signature and Certificate
- There are 7 steps involved in building an Android application package: Resource code generation, Interface code generation, Java compilation, Byte code conversion, Packaging, Signing the package, Aligning the package.
- The "ant debug/release" command does all 7 steps of the build process automatically.
- "aapt (Android Asset Packaging Tool)" is a nice tool that can be used to perform resource code generation and packaging.
- "javac (Java Compiler)" is a tool provided by the JDK (Java Development Kit).
- "dx.bat" is a batch file that invokes the "dex" tool to convert Java byte code to DEX (Dalvik Executable) code.
- "apkbuilder.bat" is a batch file that performs the packaging and signing steps.
- "zipalign" is a command that aligns files in an .apk package file properly to improve performance.
- An .apk package file is really a ZIP file.
- The debug version of an Android application package is signed by a debug private-public key pair,
which is self-signed and can not be verified with any root certificate authorities.
- The package signature is stored in the META-INFO\CERT.RSA file in the package. The signature is really
the SHA1 signature of the digest file, META-INFO\CERT.SF.
Table of Contents
About This Book
Installing JDK 1.8 on Windows System
Installation of Android SDK R24 and Emulator
Installing Apache Ant 1.9 on Windows System
Developing First Android Application - HelloAndroid
Android Application Package (APK) Files
Android Debug Bridge (adb) Tool
Android File Systems
Android 4.0.3 File Systems
AboutAndroid - Application to Retrieve System Information
android.app.Activity Class and Activity Lifecycle
View Objects and Layout Resource Files
Using "adb logcat" Command for Debugging
►Build Process and Package File Content
Building Your Own Web Browser
Android Command Line Shell
Samsung Galaxy Tab 3 Mini Tablet
USB Debugging Applications on Samsung Tablet
Android Tablet - LG-V905R
USB Debugging Applications on LG-V905R Tablet
Android Phone - LG-P925g
USB Debugging Applications on LG-P925g Phone
Full Version in PDF/EPUB