App size optimization

Updated

Reduce the size of apps that integrate Agora SDK

Reducing the app size is of great significance in improving user experience. A smaller package size means that users consume less bandwidth and time to download the app. Consider the following use-cases where app size optimization is critical:

  • There are strict requirements on the size of the app. For example, running the app on smart wearable devices with limited storage space.

  • The target user group of the app is located in underdeveloped areas. The poor network connectivity causes the app download time to be too long.

This page shows you how to optimize the size of apps with integrated RTC SDK.

Use the Lite SDK

Since version 4.4.0, Agora offers a Lite SDK that provides basic audio and video call functions in a smaller package size. If you only need to implement basic audio and video call functions, integrate the Lite SDK. For details see SDKs.

The Lite SDK includes only the following extensions:

  • Video encoding extension
  • Video decoding extension

Other extensions and related functions in the Extension list are not supported.

Use the Voice SDK

RTC SDK supports both audio and video functions, and the package size is large. If you only need to use audio features, best practice is to integrate the Voice SDK. For details, see Voice SDK Quickstart.

Remove unnecessary extensions

RTC SDK provides optional extension dynamic libraries. The name of the extension is suffixed with extension. See the extension list for details on the function and size of the extensions. Refer to the following ways to exclude these extensions to reduce the size of the app.

Remove extensions when integrating manually

When integrating through the Direct download link, manually delete the extension files that you do not need to use.

Remove extensions when integrating using Maven Central

When integrating the Android SDK through Maven Central, you can modify the /Gradle Scripts/build.gradle(Module: <projectname>.app) file to specify the dynamic libraries you need to integrate and exclude extensions you do not need to use. For details on the correspondence between each file in the Android SDK and the fields in dependencies, see implementation fields for details.

Refer to the following samples to include, all, none, or selected extensions.

Use all extensions

dependencies {
 implementation 'io.agora.rtc:full-sdk:4.0.1'
 implementation 'io.agora.rtc:full-screen-sharing:4.0.1'
 // ...
}

Don

dependencies {
 implementation 'io.agora.rtc:full-rtc-basic:4.0.1'
 //...
}

Use selected extensions

dependencies {
 def agora_sdk_version = "4.3.0"
 // The following code contains $, so you must use double-quotes
 implementation "io.agora.rtc:full-rtc-basic:\${agora_sdk_version}"
 implementation "io.agora.rtc:full-ains:\${agora_sdk_version}"
 implementation "io.agora.rtc:audio-beauty:\${agora_sdk_version}"
 //...
}

Reference

This section contains content that completes the information in this page, or points you to documentation that explains other aspects to this product.

Extension list

Refer to the following information for an introduction to each RTC SDK extension and the increase in the size of your app after integration.

The information in this section is based on version 4.4.0 of the RTC SDK.

Integrating extensions into your project

When integrating the Android SDK through Maven Central, you can modify the dependencies field in the /Gradle Scripts/build.gradle(Module: <projectname>.app) file to specify the dynamic libraries you need to integrate. The correspondence between each file and implementation field in the SDK is detailed in the table below:

Android RTC SDK

FileCategoryimplementation field
  • agora-rtc-sdk.jar
  • libagora-rtc-sdk.so
  • libagora-fdkaac.so
  • libagora-ffmpeg.so
  • libagora-soundtouch.so
  • libvideo_dec.so (added since v4.6.2)
  • libagora-core.so (renamed to libaosl.so since v4.3.0; dependency since v4.5.0)
  • SDK header files
Requiredio.agora.rtc:full-rtc-basic
libaosl.so (dependency since v4.5.0)Requiredio.agora.infra:aosl
libagora_ai_noise_suppression_extension.soOptionalio.agora.rtc:ains
libagora_ai_noise_suppression_ll_extension.soOptionalio.agora.rtc:ains-ll (≥ v4.4.0)
libagora_audio_beauty_extension.soOptionalio.agora.rtc:audio-beauty
libagora_clear_vision_extension.soOptionalio.agora.rtc:clear-vision
libagora_content_inspect_extension.soOptionalio.agora.rtc:full-content-inspect
libagora_screen_capture_extension.soOptionalio.agora.rtc:screen-capture
AgoraScreenShareExtension.aarOptionalio.agora.rtc:full-screen-sharing
libagora_segmentation_extension.soOptionalio.agora.rtc:full-virtual-background
libagora_spatial_audio_extension.soOptionalio.agora.rtc:spatial-audio
libagora_pvc_extension.soOptionalio.agora.rtc:pvc (< v4.1.0)
libagora_super_resolution_extension.soOptionalio.agora.rtc:full-super-resolution (< v4.1.1)
libagora_drm_loader_extension.soOptionalio.agora.rtc:drm-loader (v4.1.0 to v4.2.6)
libagora_udrm3_extension.soOptionalio.agora.rtc:drm (v4.1.0 to v4.2.6)
libagora_ai_echo_cancellation_extension.soOptionalio.agora.rtc:aiaec (≥ v4.1.0)
libagora_ai_echo_cancellation_ll_extension.soOptionalio.agora.rtc:aiaec-ll (≥ v4.4.0)
libagora_video_quality_analyzer_extension.soOptionalio.agora.rtc:full-vqa (≥ v4.1.0)
libagora_face_detection_extension.soOptionalio.agora.rtc:full-face-detect (≥ v4.1.1)
libagora_face_capture_extension.soOptionalio.agora.rtc:full-face-capture (≥ v4.3.0)
  • libagora_video_encoder_extension.so
  • libvideo_enc.so
Optionalio.agora.rtc:full-video-codec-enc (≥ v4.2.0)
  • libagora_video_decoder_extension.so
  • libvideo_dec.so
Optionalio.agora.rtc:full-video-codec-dec (v4.2.0 to v4.6.1)
libagora_video_av1_encoder_extension.soOptionalio.agora.rtc:full-video-av1-codec-enc (≥ v4.3.0)
libagora_video_av1_decoder_extension.soOptionalio.agora.rtc:full-video-av1-codec-dec (v4.3.0 to v4.6.1)
libagora_lip_sync_extension.soOptionalio.agora.rtc:full-lip-sync (≥ v4.3.1)

Android Voice SDK

FileCategoryimplementation field
  • agora-rtc-sdk.jar
  • libagora-rtc-sdk.so
  • libagora-fdkaac.so
  • libagora-soundtouch.so
  • libagora-core.so (renamed to libaosl.so since v4.3.0; dependency since v4.5.0)
  • SDK header files
Requiredio.agora.rtc:voice-rtc-basic
libaosl.so (dependency since v4.5.0)Requiredio.agora.infra:aosl
libagora_ai_noise_suppression_extension.soOptionalio.agora.rtc:ains
libagora_ai_noise_suppression_ll_extension.soOptionalio.agora.rtc:ains-ll (≥ v4.4.0)
libagora_audio_beauty_extension.soOptionalio.agora.rtc:audio-beauty
libagora_spatial_audio_extension.soOptionalio.agora.rtc:spatial-audio
libagora_drm_loader_extension.soOptionalio.agora.rtc:drm-loader (≥ v4.1.0)
libagora_udrm3_extension.soOptionalio.agora.rtc:drm (v4.1.0 to v4.2.6)
libagora_ai_echo_cancellation_extension.soOptionalio.agora.rtc:aiaec (≥ v4.1.0)
libagora_ai_echo_cancellation_ll_extension.soOptionalio.agora.rtc:aiaec-ll (≥ v4.4.0)

Frequently asked questions