APK (Android Package Kit) is an archive file format used for distributing and installing applications on Android. Every application that a user downloads from Google Play or installs manually is an APK file. According to Android Open Source Project, 2026, the format is based on the ZIP standard and contains compiled code, resources, a manifest, and a digital signature.
মূল বিষয়সমূহ
APK (Android Package Kit) is an archive format used to package Android applications for distribution. Technically, APK is a ZIP archive with a specific structure containing all the components necessary for the application to run on a device.
The APK format appeared with the first version of Android in 2008. It was based on the JAR (Java Archive) standard, which in turn is based on ZIP. This inheritance ensured compatibility with existing archive tools — any archiver can open APK as a regular ZIP.
Google Play is the primary channel for distributing APK, but the format is also used in other scenarios: direct installation via browser (sideloading), enterprise app stores, testing on developer devices, and installation in emulators. According to Statista, about 15% of Android app installations in 2025 occur outside Google Play.
The internal structure of APK is strictly regulated: every application must contain specific files and directories. Violating the structure leads to installation errors.
| File/Directory | উদ্দেশ্য |
|---|---|
| AndroidManifest.xml | Application manifest: permissions, components, SDK version |
| classes.dex | Compiled DEX bytecode (can be multiple files) |
| resources.arsc | Compiled resources: strings, styles, layouts |
| res/ | Uncompiled resources: images, fonts, XML |
| lib/ | Native libraries (.so) for different CPU architectures |
| META-INF/ | Metadata: certificates, file lists, hashes |
The manifest is the central configuration file of the application. In binary compiled form (not readable XML), it contains the package name, version, list of activities, services, permissions, and SDK requirements. Without a manifest, the system does not know how to launch the application.
Source code in Java or Kotlin is compiled into DEX (Dalvik Executable) files. The main file is called classes.dex. If the bytecode exceeds the 64K method limit, classes2.dex, classes3.dex, and so on are created — the multidex mechanism.
The lib/ directory contains compiled C/C++ libraries for different architectures: armeabi-v7a, arm64-v8a, x86, x86_64. Each library has the .so (Shared Object) extension. Modern applications typically ship only arm64-v8a.
Building an APK is a multi-stage process automated by the Gradle build system and Android Gradle Plugin. Each stage transforms source files into components of the final archive.
Source code is compiled into Java bytecode (.class), then converted to DEX using the d8 tool (previously dx). Resources are compiled into binary format via AAPT2. All components are packed into a ZIP archive and signed with a digital signature.
// build.gradle.kts — APK বিল্ডের মৌলিক কনফিগরেশন
android {
defaultConfig {
applicationId = "com.example.app"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0.0"
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt")
)
}
}
}
ProGuard or R8 obfuscates code, removes unused classes and methods, reducing APK size. Without obfuscation, APK contains full class names, which simplifies decompilation. R8 also performs bytecode optimization at the DEX level.
A digital signature is a mandatory element of APK. Android does not install unsigned packages. The signature guarantees that the application has not been modified after publication and determines who owns the package.
v1 (JAR signing) is the original scheme based on signing each file in the archive. Vulnerability: files can be removed from META-INF without detection. v2 (APK Signature Scheme v2) appeared in Android 7.0 — the entire archive is signed as a whole, preventing modification. v3 supports key rotation, and v4 supports incremental installation.
Google Play requires v2 or higher for all new applications since August 2021. It is recommended to sign APK with all three schemes for maximum compatibility with different Android versions.
In build.gradle, the keystore, password, and alias are specified. The private key is stored in an encrypted store. For publishing to Google Play, App Signing is used — Google stores the private key, and the developer uploads a signed APK.
Installation of APK is performed through the system package manager PackageManager. The process includes signature verification, manifest parsing, file copying, and DEX optimization via dex2oat.
The ADB (Android Debug Bridge) tool allows installing APK directly from a developer’s computer. The command `adb install app.apk` copies the file to the device and starts installation. The -r flag reinstalls the application while preserving data, and the -d flag allows installing a version with a lower versionCode.
Starting from Android 8.0, the system requires confirmation for installation from unknown sources for each application separately. Android 14 tightened control: installing APK through third-party stores is only possible after explicit permission in settings. Google Play Protect scans every APK during installation for malicious code.
For applications larger than 150 MB, Google Play supports Expansion Files — additional OBB packages of up to 2 GB each. OBB files are not included in the APK but are downloaded separately after installation. The format supports two types: main (base resources) and patch (updates).
// PackageManager এর মাধ্যমে APK সংস্করণ যাচাই
val pm = packageManager
val info = pm.getPackageInfo(
"com.example.app",
PackageManager.GET_ACTIVITIES
)
Log.d("APK", "Version: ${info.versionName}")
On devices with ART (Android Runtime), after installation, DEX compilation into native code is launched via dex2oat. The process can take several seconds and increases the size of the installed application, but speeds up its launch.
AAB (Android App Bundle) is a format that Google promotes as an alternative to APK for publishing on Google Play. The difference is fundamental: AAB is not installed directly but serves as a container from which Google Play generates optimized APKs.
| প্যারামিটার | APK | AAB |
|---|---|---|
| ডাউনলোড আয়তন | সম্পূর্ণ আর্কাইভ | শুধুমাত্র প্রয়োজনীয় উপাদান |
| সরাসরি ইনস্টলেশন | হ্যাঁ | না (APK উত্পাদন) |
| বিতরণ | যে কোনো চ্যানেল | Google Play |
| সংস্করণ নিয়ন্ত্রণ | ম্যানিফেস্টে সংস্করণ | Dynamic Delivery |
| প্রকাশনা | Google Play + তৃতীয় পক্ষ | Google Play |
Google Play has required AAB since August 2021 for new applications. However, APK remains the main format for distribution outside Google Play — through websites, enterprise stores, and testing.
Developers regularly encounter issues when building and installing APK. Most of them are related to version incompatibility, signing, or archive structure.
This error occurs when trying to install an APK with the same package name but a different signature. Android does not allow reinstalling an application with a changed certificate. The solution is to uninstall the old version before installation.
If the project exceeds the 65536 method limit, the build fails with a dex error. The solution is to enable multidex in build.gradle or optimize dependencies by removing unused libraries.
Google Play limits APK size to 150 MB. For larger applications, APK Expansion Files (OBB) are used. It is recommended to reduce size through R8, WebP images, and Android App Bundle. Each extra megabyte negatively affects installation conversion: according to Google, every 10 MB reduces conversion by 1%.
APK can be decompiled using tools like JADX, APKTool, or Bytecode Viewer. JADX restores original Java code from DEX, making applications without obfuscation fully readable. For code protection, ProGuard/R8 is used, which renames classes, methods, and fields into short unreadable names, and also removes debug information.
To analyze APK contents, Android Studio Profiler, apkanalyzer (CLI tool from Android SDK), and third-party utilities are used. apkanalyzer shows the size of each APK component: DEX, resources, native libraries, and signature. Analysis helps identify which dependencies take up the most space and make decisions about replacing or removing them.
প্রায়শই জিজ্ঞাসিত প্রশ্ন
হ্যাঁ, any archiver (7-Zip, WinRAR) opens APK as a ZIP. You can view the contents, but decompiling the code requires special tools — JADX or apktool.
XAPK is an unofficial format used by some third-party stores. It combines APK with additional OBB files into one archive. Google Play and official Android documentation do not use XAPK.
Android Studio automatically signs the debug build with debug.keystore when running on a device. To distribute a test version to the team, signing with a release key or using App Signing is required.
Use R8 for obfuscation and minification, convert images to WebP, remove unused resources via Lint, and for large projects switch to Android App Bundle with Dynamic Delivery.
No — any modification to APK after signing breaks the digital signature. To update, you need to build and sign a new version with an incremented versionCode.
সারাংশ
আমরা একটি মোবাইল অ্যাপ্লিকেশন টার্নকি তৈরি করব
IT Sectr 2017 সাল থেকে স্টার্টআপ এবং ব্যবসার জন্য iOS এবং Android অ্যাপ্লিকেশন তৈরি করে। আমরা আপনাকে পরামর্শ দেব এবং সেরা সমাধান প্রস্তাব করব।
আরও পড়ুন