How does Super App reduce the size of the application even though it contains a lot of features and images?

Tram Ho

Dear everyone,

In this article, I would like to share my perspective and knowledge that I have learned and I see this as a new trend to improve mobile app products. If something is not correct, please advise. (Here I take the example problem that in the company there are many different internal apps for employees)

[Topic]

  1. Internal projects The current situation in large companies is that there are many internal applications (For example: Sales, KPI, Marketing…) that make employees have to download many different applications to use. in work because an application only supports a certain group of jobs. Create a base application containing all products/applications as sub modules.
  2. The Customer Management app has a decentralized function, so some functions will not be active with a group of users, but with the current mechanism, the entire source code/resource (image, string …) will still be available. preloaded in the app even when not in use. Or simply, the next time Funny App will be integrated into the Customer Management app as a sub module, which will also make the Customer Management app increase the app size.

[Target]

Create 1 All In One app (with Internal Project), reduce app download size when installing app on store

[Hard]

  • The size of each basic app is already large (Android: ~35-70MB/app, iOS: ~100-150Mb), if you deploy all in one app in the usual way (add it directly as a module to import into the base), then The size of the app base will increase roughly with each module added to the app base.

[Solution]

Some Big apps (Momo, Zalo, VinID…) in addition to some basic features, it contains a lot of advanced features (each feature is equivalent to 1 sub module and works independently) with graphics, animation… which still has an acceptable app size for a mobile app for the first install.

  • Zalo: Android ~ 21Mb, iOS ~150Mb
  • Momo: Android ~ 90Mb, iOS ~164Mb
  • VinID: Android ~ 60Mb, iOS ~221Mb

1. Android Native

– Dynamic Feature ModulesIn 2018 at the Google I/O event, Google introduced a new installation format Android App Bundle(.aab) so that users will only need to download the portion of resources they need (e.g. download 1 in the following types of image formats: mhdpi, xhdpi, xxhdpi…) to run the app on your device. But it still downloads all the resources in your machine without needing it in the first place. so basically the app size is still large.Google has introduced “dynamic feature modules” so that users can download features/modules as needed so it will be able to reduce the app size when the user first downloads the app. Dynamic Delivery Split APKs will basically be like normal apks (including codes, resources, data …) and it will only download when needed and avoid downloading unused resources. .

Base APK is an apk that contains common code and resources that are accessible to all other split apks and provides basic functionality for the application. When the user installs, BaseApk will be installed first because it will fully declare services, content-providers, permissions, platform version, dependencies…Configuration APKs is where the native library and resources are located for each level. screen resolution, CPU architecture, language. Each Config Apk will depend on a Base Apk or Dynamic Future APK and it will be downloaded and installed along with the Future APK on which they depend. required for the first time installing the application. It uses Play Core Library to be able to install Feature Dynamic Apks after the Base Apk is installed.

Attention:

  • Dynamic Feature Modules only support from Android 4.4 (API 19) and above
  • When we only update 1 Dynamic Feature Module, we still have to upload the entire source code to the Google Store (including Base and Dynamic Features) so that Google can check the compatibility between the modules. (Hopefully in the future Google can develop Dynamic Feature updates without having to update the app again). But when the user updates the app, the Play Store will decide what the user will download through Google’s delta updates, so the download will also be optimized.

Documentation: https://developer.android.com/guide/playcore/feature-delivery?hl=en https://medium.com/mindorks/dynamic-feature-modules-the-future-4bee124c0f1

2. iOS Native

It seems that iOS also has a similar method (On Demand Resource) to reduce the size of the application, but the difference is that On Demand Resource only shares data and resources, not code.

With each level, the new app downloads the necessary resources. Although a bit less, it seems to be enough for us to achieve the goal of reducing the size of the application.

Documentation: https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/On_Demand_Resources_Guide/index.html

3. Flutter

Flutter is capable of building applications that can download additional Dart assets and code at runtime. This allows apps to reduce apk size to install and download features and content as needed by the user. I see it only has a guide for Android and its mechanism is the same as Dynamic Feature Modules on Android Native and there is no documentation for iOS Native

Documentation: https://docs.flutter.dev/perf/deferred-components

Share the news now

Source : Viblo