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 Voice SDK from a download:
-
Extract the files from the Android download to a local folder,
<unzipped_package>
. -
Copy the following files and folders from
<unzipped_package>/rtc/sdk
to your project:SDK File or folder Path 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/
-
Select
Project Files/app/libs/agora-rtc-sdk.jar
file on navigation bar, right-click and then selectadd 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: -
If you do not need to use any plugin, specify the
dependencies
as follows: -
If you only need to use specific plugins such as the AI noise reduction plugin and Bel Canto plugin, specify the
dependencies
as follows:
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:
- Download the latest version of the SDK and decompress it.
- Integrate
agora-rtc-sdk.jar
into your project. - 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. - 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. - When calling
create
to create and initialize anRtcEngine
instance, set themNativeLibPath
config parameter to the app private directory where the.so
file is located. - 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.
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.
The following table shows the plugin library name, and the increase in app size after integration for each architecture:
Plugin | Architecture | Library name | Increase in app after integration (KB) |
---|---|---|---|
AI noise reduction | arm64-v8a | libagora_ai_noise_suppression_extension.so | 2448 |
armeabi-v7a | libagora_ai_noise_suppression_extension.so | 2315 | |
x86_64 | libagora_ai_noise_suppression_extension.so | 58 | |
x86 | libagora_ai_noise_suppression_extension.so | 57 | |
Bel canto | arm64-v8a | libagora_audio_beauty_extension.so | 948 |
armeabi-v7a | libagora_audio_beauty_extension.so | 764 | |
x86 | libagora_audio_beauty_extension.so | 721 | |
x86_64 | libagora_audio_beauty_extension.so | 721 | |
Video enhancement | arm64-v8a | libagora_clear_vision_extension.so | 776 |
armeabi-v7a | libagora_clear_vision_extension.so | 695 | |
x86 | libagora_clear_vision_extension.so | 798 | |
x86_64 | libagora_clear_vision_extension.so | 817 | |
Video screenshot upload | arm64-v8a | libagora_content_inspect_extension.so | 1071 |
armeabi-v7a | libagora_content_inspect_extension.so | 943 | |
x86 | libagora_content_inspect_extension.so | 57 | |
x86_64 | libagora_content_inspect_extension.so | 56 | |
PVC insert | arm64-v8a | libagora_pvc_extension.so | 170 |
armeabi-v7a | libagora_pvc_extension.so | 120 | |
Spatial audio plugin | arm64-v8a | libagora_spatial_audio_extension.so | 3258 |
armeabi-v7a | libagora_spatial_audio_extension.so | 3080 | |
x86 | libagora_spatial_audio_extension.so | 3029 | |
x86_64 | libagora_spatial_audio_extension.so | 3024 | |
Virtual background | arm64-v8a | libagora_segmentation_extension.so | 2756 |
armeabi-v7a | libagora_segmentation_extension.so | 2462 | |
Copyright music | arm64-v8a |
| 1413 |
armeabi-v7a |
| 1014 | |
x86_64 |
| 1444 | |
x86 |
| 1403 | |
Face recognition | arm64-v8a | libagora_face_detection_extension.so | 488 |
armeabi-v7a | libagora_face_detection_extension.so | 329 | |
x86_64 | libagora_face_detection_extension.so | 138 | |
x86 | libagora_face_detection_extension.so | 135 | |
Super resolution | arm64-v8a | libagora_super_resolution_extension.so | 214 |
armeabi-v7a | libagora_super_resolution_extension.so | 161 | |
Screen sharing | arm64 | libagora_screen_capture_extension.so | 675 |
armv7 | libagora_screen_capture_extension.so | 675 | |
arm64 & armv7 | AgoraScreenShareExtension.aar | 69 | |
Video quality assessment | arm64-v8a | libagora_video_quality_analyzer_extension.so | 570 |
armeabi-v7a | libagora_video_quality_analyzer_extension.so | 462 | |
x86_64 | libagora_video_quality_analyzer_extension.so | 59 | |
x86 | libagora_video_quality_analyzer_extension.so | 58 | |
AI echo cancellation | arm64-v8a | libagora_ai_echo_cancellation_extension.so | 3403 |
armeabi-v7a | libagora_ai_echo_cancellation_extension.so | 3238 | |
x86_64 | libagora_ai_echo_cancellation_extension.so | 58 | |
x86 | libagora_ai_echo_cancellation_extension.so | 56 |
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.
Copyright music plugin
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
File | Category | implementation field |
---|---|---|
| required | io.agora.rtc:full-rtc-basic |
libagora_ai_noise_suppression_extension.so | optional | io.agora.rtc:ains |
libagora_audio_beauty_extension.so | optional | io.agora.rtc:audio-beauty |
libagora_clear_vision_extension.so | optional | io.agora.rtc:clear-vision |
libagora_content_inspect_extension.so | optional | io.agora.rtc:full-content-inspect |
libagora_screen_capture_extension.so | optional | io.agora.rtc:screen-capture |
AgoraScreenShareExtension.aar | optional | io.agora.rtc:full-screen-sharing |
libagora_segmentation_extension.so | optional | io.agora.rtc:full-virtual-background |
libagora_spatial_audio_extension.so | optional | io.agora.rtc:spatial-audio |
libagora_pvc_extension.so | optional | io.agora.rtc:pvc (< v4.1.0) |
libagora_super_resolution_extension.so | optional | io.agora.rtc:full-super-resolution (< v4.1.1) |
libagora_drm_loader_extension.so | optional | io.agora.rtc:drm-loader (≥ v4.1.0) |
libagora_udrm3_extension.so | optional | io.agora.rtc:drm (≥ v4.1.0) |
libagora_ai_echo_cancellation_extension.so | optional | io.agora.rtc:aiaec (≥ v4.1.0) |
libagora_face_detection_extension.so | optional | io.agora.rtc:full-roi-enc (≥ v4.1.1) |
libagora_video_quality_analyzer_extension.so | optional | io.agora.rtc:full-vqa (≥ v4.1.0) |
libagora_face_detection_extension.so | optional | io.agora.rtc:full-face-detection (≥ v4.1.1) |
Android Audio SDK
File | Category | implementation field |
---|---|---|
| required | io.agora.rtc:voice-rtc-basic |
libagora_ai_noise_suppression_extension.so | optional | io.agora.rtc:ains |
libagora_audio_beauty_extension.so | optional | io.agora.rtc:audio-beauty |
libagora_spatial_audio_extension.so | optional | io.agora.rtc:spatial-audio |
libagora_drm_loader_extension.so | optional | io.agora.rtc:drm-loader (≥ v4.1.0) |
libagora_udrm3_extension.so | optional | io.agora.rtc:drm (≥ v4.1.0) |
libagora_ai_echo_cancellation_extension.so | optional | io.agora.rtc:aiaec (≥ v4.1.0) |