Skip to main content

You are viewing Agora Docs forBeta products and features. Switch to Docs

App size optimization

A smaller app size means quicker download and installation times, which can lead to a better user experience. This page shows you how to manually install the Video SDK and reduce the app size of the SDK integrated app.

Manual installation

To manually install Video SDK from a download:

  1. Extract the files from the Android download to a local folder, <unzipped_package>.

  2. Copy the following files and folders from <unzipped_package>/rtc/sdk to your project:

    SDK File or folderPath in your project
    Files:
    agora-rtc-sdk.jar/app/libs/
    Folders:
    arm-v8a/app/src/main/jniLibs/
    armeabi-v7a/app/src/main/jniLibs/
    x86/app/src/main/jniLibs/
    x86_64/app/src/main/jniLibs/
    high_level_api/include/app/src/main/jniLibs/
  3. Select Project Files/app/libs/agora-rtc-sdk.jar file on navigation bar, right-click and then select add as a library.

Reduce the app size

To reduce the app size, implement the following strategies:

Use the audio SDK

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

Remove unneeded plugins

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

Manual integration

When integrating through the official SDK download link, delete the plugin files you don't need.

Integration through Maven Central

When integrating the Android SDK through Maven Central, you can modify the dependencies in the /Gradle Scripts/build.gradle(Module: <projectname>.app) file to specify the dynamic libraries you need to integrate, and exclude the plugins you don't need. For the relationship between each file in the Android SDK and the gradle dependencies, see dependency implementation.

Refer to the following examples to include all plugins, exclude all plugins, or to include only the specified plugins.

  • If you need to use all plugins, specify the dependencies as follows:


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

  • If you do not need to use any plugin, specify the dependencies as follows:


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

  • If you only need to use specific plugins such as the AI ​​noise reduction plugin and Bel Canto plugin, specify the dependencies as follows:


    _7
    dependencies {
    _7
    def agora_sdk_version = "4.0.1"
    _7
    implementation "io.agora.rtc:full-rtc-basic:${agora_sdk_version}"
    _7
    implementation "io.agora.rtc:full-ains:${agora_sdk_version}"
    _7
    implementation "io.agora.rtc:audio-beauty:${agora_sdk_version}"
    _7
    ...
    _7
    }

Dynamically Load .so Files

To reduce the size of the app's installation package, Video SDK provides the mNativeLibPath attribute in the RtcEngineConfig class to support dynamic loading of the required .so files. Refer to the following steps to implement this feature:

  1. Download the latest version of the SDK and decompress it.
  2. Integrate agora-rtc-sdk.jar into your project.
  3. Upload the .so files for all architectures to your server and make sure that the app can download the .so files for the target architecture over the network.
  4. When the app runs, it checks for the existence of an .so file. If not found, it downloads the .so file and saves it to the private directory of the app.
  5. When calling create to create and initialize an RtcEngine instance, set the mNativeLibPath config parameter to the app private directory where the .so file is located.
  6. After calling create successfully, the SDK automatically loads the .so file from the specified path.

This method is only suitable for manually integrating the Android SDK, not for integration through Maven Central.

Reference

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

Plugin list

This section provides information on including plugins provided with Video SDK.

The following table shows the plugin library name, and the increase in app size after integration for each architecture:

PluginArchitectureLibrary nameIncrease in app after integration (KB)
AI noise reductionarm64-v8alibagora_ai_noise_suppression_extension.so2448
armeabi-v7alibagora_ai_noise_suppression_extension.so2315
x86_64libagora_ai_noise_suppression_extension.so58
x86libagora_ai_noise_suppression_extension.so57
Bel cantoarm64-v8alibagora_audio_beauty_extension.so948
armeabi-v7alibagora_audio_beauty_extension.so764
x86libagora_audio_beauty_extension.so721
x86_64libagora_audio_beauty_extension.so721
Video enhancementarm64-v8alibagora_clear_vision_extension.so776
armeabi-v7alibagora_clear_vision_extension.so695
x86libagora_clear_vision_extension.so798
x86_64libagora_clear_vision_extension.so817
Video screenshot uploadarm64-v8alibagora_content_inspect_extension.so1071
armeabi-v7alibagora_content_inspect_extension.so943
x86libagora_content_inspect_extension.so57
x86_64libagora_content_inspect_extension.so56
PVC insertarm64-v8alibagora_pvc_extension.so170
armeabi-v7alibagora_pvc_extension.so120
Spatial audio pluginarm64-v8alibagora_spatial_audio_extension.so3258
armeabi-v7alibagora_spatial_audio_extension.so3080
x86libagora_spatial_audio_extension.so3029
x86_64libagora_spatial_audio_extension.so3024
Virtual backgroundarm64-v8alibagora_segmentation_extension.so2756
armeabi-v7alibagora_segmentation_extension.so2462
Copyright musicarm64-v8a
  • libagora_drm_loader_extension
  • libagora_udrm3_extension.so
1413
armeabi-v7a
  • libagora_drm_loader_extension
  • libagora_udrm3_extension.so
1014
x86_64
  • libagora_drm_loader_extension
  • libagora_udrm3_extension.so
1444
x86
  • libagora_drm_loader_extension
  • libagora_udrm3_extension.so
1403
Face recognitionarm64-v8alibagora_face_detection_extension.so488
armeabi-v7alibagora_face_detection_extension.so329
x86_64libagora_face_detection_extension.so138
x86libagora_face_detection_extension.so135
Super resolutionarm64-v8alibagora_super_resolution_extension.so214
armeabi-v7alibagora_super_resolution_extension.so161
Screen sharingarm64libagora_screen_capture_extension.so675
armv7libagora_screen_capture_extension.so675
arm64 & armv7AgoraScreenShareExtension.aar69
Video quality assessmentarm64-v8alibagora_video_quality_analyzer_extension.so570
armeabi-v7alibagora_video_quality_analyzer_extension.so462
x86_64libagora_video_quality_analyzer_extension.so59
x86libagora_video_quality_analyzer_extension.so58
AI echo cancellationarm64-v8alibagora_ai_echo_cancellation_extension.so3403
armeabi-v7alibagora_ai_echo_cancellation_extension.so3238
x86_64libagora_ai_echo_cancellation_extension.so58
x86libagora_ai_echo_cancellation_extension.so56

AI noise reduction plugin

The 4.x SDK supports the new version of AI noise reduction. The new version of AI noise reduction has better human voice fidelity, cleaner noise suppression, and adds the de-reverberation ability.

Bel canto plugin

The Bel Canto plugin provides a series of preset vocal effects, and also supports custom vocal effects through settings such as pitch, sound balance, and reverb. After integrating the bel canto plugin, you can call the following method to enable the bel canto effect you want:

  • setVoiceBeautifierPreset: Talking bel canto, singing bel canto, timbre change.
  • setAudioEffectPreset: Changing sound effects, genre sound effects, space shaping, electronic sound effects.
  • setVoiceConversionPreset: Basic voice changer.
  • setLocalVoicePitch, setLocalVoiceEqualization, setLocalVoiceReverb: Adjust the pitch, equalization and reverb effects to get the desired vocal effect.

Video enhancement plugin

The video enhancement plugin provides basic beauty, video noise reduction, dark light enhancement, color enhancement and other capabilities. After integrating the video enhancement plugin, you can call the following methods to enable the video enhancement function you want:

  • setBeautyEffectOptions: Set the basic beauty function.
  • setVideoDenoiserOptions: Set the video noise reduction function.
  • setLowlightEnhanceOptions: Set the low light enhancement function.
  • setColorEnhanceOptions: Set the color enhancement function.

Video screenshot upload plugin

The video screenshot upload plugin provides the ability to screenshot and upload videos sent by local users to meet the needs of video content supervision. After integrating the video screenshot upload plugin, you can call enableContentInspect to enable video screenshot upload.

PVC insert

PVC (Perceptual Video Coding) is a video coding method that reduces bandwidth consumption while ensuring the same image quality. Use it to improve video fluency in scenarios with limited bandwidth, and reduce traffic consumption in mobile network scenarios. If you need to use this function, please contact technical support.

Since v4.1.0, the SDK statically compiles the PVC library by default, and no longer provides plugins. If you have integrated the PVC plugin, you need to remove the PVC plugin from the project dependencies and recompile the project after upgrading.

Spatial audio plugin

The spatial audio plugin shapes the sense of direction of the remote user's voice. It simulates the propagation process of sound in the real world to realize the spatial sound effect when the local user listens to a remote user.

Virtual background plugin

After integrating the virtual background plugin, you can call enableVirtualBackground to enable the virtual background. Use a custom background image, a green screen to replace the original background image of the local user, or blur the background.

Starting from v4.1.0, the SDK provides a copyrighted DRM (Data Rights Management) music plugin to realize functions related to playing copyrighted music in real-time, interactive scenes, such as retrieving music resources, obtaining music lists and list details, preloading and playing music resources, downloading lyrics and posters, etc. See the v4.1.0 Release Notes for details.

Face recognition plugin

Agora provides a face recognition plugin since v4.1.1, that recognizes faces or portraits through face or virtual background segmentation algorithms. It uses higher-quality encoding for the ROI (Region of Interest) area during the encoding process to achieve sharper face or portrait effect. If you need to use this function, please contact technical support.

Super resolution plugin

After integrating the super-resolution plugin, you can call enableRemoteSuperResolution to increase the resolution of the remote video.

Since v4.1.1, the SDK statically compiles the super-resolution library by default. It no longer provides a plugin method. If you have previously integrated the super-resolution plugin, you need to remove it from the project dependencies and recompile the project after upgrading.

Screen sharing plugin

The screen sharing plugin supports sharing your own screen content with the audience or other users to improve communication efficiency. See screen sharing for details .

Video quality assessment plugin

Since v4.1.0, the SDK provides a Video Quality Assessment (VQA) plugin, which simulates the subjective feelings of real people to score video quality. If you need to use this function, please contact technical support.

AI echo cancellation plugin

The AI echo cancellation plugin preserves complete, clear, and smooth near-end human voice, even under poor echo-to-signal ratio, and significantly improves the system's echo cancellation. The dual-speak performance gives users a more comfortable call and live broadcast experience. It is widely used in conferences, voice chats, karaoke and other scenarios. If you need to use this function, please contact technical support.

Dependency implementation

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

Android Video SDK

FileCategoryimplementation field
  • agora-rtc-sdk.jar
  • libagora-rtc-sdk.so
  • libagora_dav1d.so
  • libagora-fdkaac.so
  • libagora-ffmpeg.so
  • libagora-soundtouch.so
  • SDK header files
requiredio.agora.rtc:full-rtc-basic
libagora_ai_noise_suppression_extension.sooptionalio.agora.rtc:ains
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)
libagora_udrm3_extension.sooptionalio.agora.rtc:drm (≥ v4.1.0)
libagora_ai_echo_cancellation_extension.sooptionalio.agora.rtc:aiaec (≥ v4.1.0)
libagora_face_detection_extension.sooptionalio.agora.rtc:full-roi-enc (≥ v4.1.1)
libagora_video_quality_analyzer_extension.sooptionalio.agora.rtc:full-vqa (≥ v4.1.0)
libagora_face_detection_extension.sooptionalio.agora.rtc:full-face-detection (≥ v4.1.1)

Android Audio SDK

FileCategoryimplementation field
  • agora-rtc-sdk.jar
  • libagora-rtc-sdk.so
  • libagora-fdkaac.so
  • libagora-soundtouch.so
  • SDK header files
requiredio.agora.rtc:voice-rtc-basic
libagora_ai_noise_suppression_extension.sooptionalio.agora.rtc:ains
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)
libagora_ai_echo_cancellation_extension.sooptionalio.agora.rtc:aiaec (≥ v4.1.0)

Interactive Live Streaming