The accessibility of an application to the user heavily relies on the number of megabytes they might expend on a download. This is quite common in emerging markets where the 2G and 3G are being utilized or is the use of pay-by-the-byte plans.
The Android App Bundle helps app developers compile all their codes and resources in a single format; this new format not only allows you to gain immediate app size saving when uploading to Google Play but also utilizes your app bundle to generate and serve optimized APKs for every user’s device configuration saving you the madness of building, signing, and managing multiple APKs for different devices; ultimately, serving users one of the smallest and optimized download available. Additionally, using the Android App Bundle format gives you a good avenue of delivering the best version of your app under 150 MB instead of compressing apps published to Google Play by uploading multiple signed APIs, which gives room for 100 MB or less.
The Android Size Analyzer tool helps recognize and execute various methods for lessening the size of your app. It is available as both an Android Studio plugin and an individual JAR.
The Android Size Analyzer plugin is readily available for download using the plugin marketplace in Android Studio. The plugin will help analyze your current project and make available suggestions to help you reduce your app size, if necessary.
The latest version of the Android Size Analyzer is readily available for download on GitHub. It can be seen as a TAR or ZIP file which would be extracted and run (size-analyzer script: Linux or Mac OS; size-analyzer.bat script on Windows) on an Android project or Android App Bundle using any of these commands:
./size-analyzer check-bundle <path-to-aab>
./size-analyzer check-project <path-to-project-directory>
Understanding the structure of your app’s APK gives you an insight into the right approach you’d require to its size reduction. A standard APK file comprises a ZIP archive that envelops everything that makes up your app, including Java class files, resource files, and a file of compiled resources. Some files ought not to be compressed, and others that are flexible.
- Removal of unused resources.
- Minimization of resource use from the library, native, animated image decoding.
- The use of vector graphics.
- Use of vector graphics for animated images.
- Support specific densities, use of readable objects, and recycling of resources.
In the end, the key is to remember the size of your APK determines the speed with which it is downloaded, how much space it takes up, and how much power it drains.