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.
To manually install Video SDK from a download:
Extract the files from the Android download to a local folder,
Copy the following files and folders from
<unzipped_package>/rtc/sdkto your project:
SDK File or folder Path in your project Files:
Project Files/app/libs/agora-rtc-sdk.jarfile on navigation bar, right-click and then select
add as a library.
To reduce the app size, implement the following strategies:
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.
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.
When integrating through the official SDK download link, delete the plugin files you don't need.
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
If you do not need to use any plugin, specify the
If you only need to use specific plugins such as the AI noise reduction plugin and Bel Canto plugin, specify the
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.
agora-rtc-sdk.jarinto your project.
- Upload the
.sofiles for all architectures to your server and make sure that the app can download the
.sofiles for the target architecture over the network.
- When the app runs, it checks for the existence of an
.sofile. If not found, it downloads the
.sofile and saves it to the private directory of the app.
- When calling
createto create and initialize an
RtcEngineinstance, set the
mNativeLibPathconfig parameter to the app private directory where the
.sofile is located.
- After calling
createsuccessfully, the SDK automatically loads the
.sofile from the specified path.
This method is only suitable for manually integrating the Android SDK, not for integration through Maven Central.
This section contains content that completes the information in this page, or points you to documentation that explains other aspects to this product.
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:
|Plugin||Architecture||Library name||Increase in app after integration (KB)|
|AI noise reduction||arm64-v8a||2448|
|Video screenshot upload||arm64-v8a||1071|
|Spatial audio plugin||arm64-v8a||3258|
|arm64 & armv7||69|
|Video quality assessment||arm64-v8a||570|
|AI echo cancellation||arm64-v8a||3403|
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 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.
setLocalVoiceReverb: Adjust the pitch, equalization and reverb effects to get the desired vocal effect.
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.
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 (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.
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.
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.
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.
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.
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 .
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.
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.
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: