Friday, May 18, 2018

Android app bundles

This is a new upload format that includes all of the app’s compiled code and resources but defers apk generation and signing to Google play

Why this used and how this is helpful?
Today with the APK, the image resources are preloaded into the resource folder for all of the device models and form factors. However, this increases the size of the downloadable when for each of the device. App bundles is Google’s new serving model called Dynamic Delivery then uses app bundle to generate and serve optimised apps for each users device configuration.

The fundamental component of dynamic delivery is the split APK mechanism available on Android 5.0 (API level 21) and higher. Split APK is similar to regular APK, however, android system is able to treat multiple split apk as single app. With split APKs, Google play can break up large app into smaller, discrete packages that are installed on users’s device as required.

Below are three types of split APKs

Base APK
This is the first apk that is installed when downloading the app. This apk contains code and resources that all other split apps can access and provide basic functionality for the app.

Configuration APKs: contains native library and resources for specific screen density, CPU architecture or language. Most of the projects Google play generates the configuration APK for a developer from the code and resources included in the app.

Dynamic feature APKs.
Contains code and resources that are not required at the initial running of an app.

To note, when we are using this feature, Google play will compile and give all the apks to the device when the app is downloaded. On devices that are running in Kitkat or below, a single apk will be delivered to the app.

Bundletool that is shipped with the Android SDK can be used for verifying the app bundle.

Bundled apps also aim to have the instant apps feature which will let the user to get instant view of the app.

References:
https://developer.android.com/guide/app-bundle/

No comments:

Post a Comment