Search code examples
androidapkandroid-install-apk

Dealing with phone architectures and processor types on Android APK file


I've generated a release apk of my Android project in order to do some internal testing via the Developer Console.

Upon generating it, I clicked to analyze the APK file. From the picture I see most of my APk allocations go to libraries and assets.

I'm focusing on the architectures of ARM X86 and X64. I believe they are processor speeds on phones and upon the APK being installed on a phone the Play Store will determine the phones processor and architectures and then download my APK based on that scenario.

My question is that with Android migrating to 64 bit architecture apps can't I get rid of the ARM architectures that aren't 64 bit based.

I'm unsure of what do do and would like to get rid of these extra architectures if possible to reduce APK size.

Please see the picture provided

enter image description here


Solution

  • Today, the vast majority of Android devices today are arm. The Device Catalog on the Play Console reports 98% of devices supported by Play are running on ARM. Although this number does not take into account devices not supported by Play or the number of users on each device, it still gives you an idea of the proportions.

    That being said, regardless of the architectures you choose to support, when publishing to Play, you should always add support for 64 bits of that architecture. For example, if you want to support arm, you must have the libraries for arm64-v8a and if you want to support x86, you must have the libraries for x86_64.

    However, to reduce APK size, there is now a better way: publishing an Android App Bundle. Play introduced this new publishing format to solve that exact problem: you publish a single App Bundle to Play, and Play takes care of generating the APKs optimized for each device, containing only the files needed for their device architecture, screen density and language (customizable).

    All it takes is to enroll in Play App Signing in the Play Console (so that Play can sign the APKs it generates on your behalf), and select "Build Android App Bundle" in Studio instead of "Build APKs". -- If you use Gradle, gradlew bundleRelease instead of gradlew assembleRelease.

    Hope that helps,