offsecnotes

APK building

by frankheat

Android application project

Note: The directory names are conventional so they could be any name. Additionally, the contents of each directory could be spread across multiple folders.

Mandatory:

Optionals:


Android package (apk)

An APK is essentially a ZIP archive with an .apk extension.

While only AndroidManifest.xml and META-INF are mandatory, an APK almost always includes the following files and directories:

Note: An APK may contain further files and folders.


Building process

Awesome resource written by Michael Zent.

  1. 📁 res (without res/values) and 🗎 AndroidManifest.xml are compiled (aapt [compile] tool)

  2. 📁 java, 📁 libs, 🗎 R.java, 🗎 android.jar are compiled (java compiler [e.g. javac] and/or kotlin compiler [e.g. kotlinc])

  3. Native code is embedded as dynamic shared libraries called Shared Object (.so)

  4. All the output are packaged (aapt [link] tool)

  5. zipalign and apksigner to sign the APK and make it installable and updatable on an Android device.