DEV Community

Zachary Powell
Zachary Powell

Posted on

How big are the AppGallery Connect SDKs anyway?

Image showing the full range of AppGallery Connect services

How to retain users in today’s increasingly competitive app market is a pressing issue within the industry, and there are many potential ways of going about it.
One of the top solutions is to reduce the size of your app so that users are less tempted to uninstall it when their storage runs low. To that end, a growing number of developers have attempted to reduce the size of their apps by integrating smaller SDKs. This article introduces the SDK sizes of various AppGallery Connect services so that you have a better understanding of how they will affect the size of your app.

SDK Direct Dependency SDK Size (KB)
AppGallery Connect base framework
agconnect-credential 103
agconnect-https 33
agconnect-core 35
datastore-annotation 3
datastore-core 6
com.huawei.hmf:tasks:1.4.1.300 25
App Linking 50
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
com.huawei.hms:hianalytics:5.0.5.301 810
App Messaging 702
com.huawei.hms:opendevice:5.0.4.301 402
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
com.squareup.picasso:picasso:2.71828 152
com.huawei.hms:hianalytics:5.0.5.301 408
Auth Service 77
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
Remote Configuration 21
com.huawei.hms:opendevice:5.0.4.301 402
agconnect-abtest 9
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
com.huawei.hms:hianalytics:5.0.5.301 408
Cloud Functions 14
agconnect-auth 77
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
Crash 65
com.huawei.hms:opendevice:5.0.4.301 402
com.huawei.hms:hianalytics:5.0.5.301 408
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
crash-native 323
agconnect-crash 65
com.huawei.hms:opendevice:5.0.4.301 402
com.huawei.hms:hianalytics:5.0.5.301 408
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
APM 237
agconnect-remoteconfig 21
com.huawei.hms:opendevice:5.0.4.301 402
com.huawei.hms:hianalytics:5.0.5.301 408
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
Cloud DB 81
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487
Cloud Storage 135
AppGallery Connect base framework 205
com.squareup.okhttp3:okhttp:3.11.0 487

As shown in the table, the largest dependent modules are HiAnalytics and the okhttp package required for sending network requests.

The HiAnalytics package consists of the hiAnalytics and opendevice modules, which have a combined size of around 1 MB. However, the actual size added by the two modules to your app is not necessarily 1 MB.

For example, the okhttp package is required for sending most network requests and may already exist in your app before you integrate any AppGallery Connect SDK.
If so, the okhttp package won’t be included when you integrate the SDK into your app and package the app, which will make your app 487 KB smaller. Meanwhile, the hiAnalytics and opendevice modules are mandatory only when you integrate Crash and APM. You can simply discard these two modules if your app does not need to collect data of services such as App Linking, App Messaging, and Remote Configuration, which further reduce your app size by 810 KB. Currently, these two modules had been decoupled from AppGallery Connect SDKs and you can add their dependencies manually as required.

Summary

If your app already contains the okhttp package, and you are not planning to integrate HUAWEI Analytics, the SDK sizes of AppGallery Connect services can be minimized.
For more information about AppGallery Connect services, please visit:
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-get-started-android-0000001058210705

Top comments (0)