RtcEngineConfig
Configures parameters for the RtcEngine instance.
public class RtcEngineConfig {
public IRtcEngineEventHandler mEventHandler;
public Context mContext;
public String mAppId;
public int mAreaCode;
public int mChannelProfile;
public String mLicense;
public int mAudioScenario;
public boolean mAutoRegisterAgoraExtensions;
public List<String> mExtensionList;
public IMediaExtensionObserver mExtensionObserver;
public LogConfig mLogConfig;
public Integer mThreadPriority;
public String mNativeLibPath;
public boolean mDomainLimit;
}
Properties
- mEventHandler
- Event callback handler. See IRtcEngineEventHandler.
- mContext
- Context object of the Android Activity.
- mAppId
- App ID issued by Agora for the project. Only users with the same App ID can join the same channel for audio and video calls. An App ID can only be used to create one RtcEngine instance. To change the App ID, you must call destroy [2/2] to destroy the original instance before creating a new one.
- mAreaCode
- Connection region, applicable in scenarios with regional restrictions. Supports bitwise OR operation to combine multiple region codes. See AreaCode.
- mChannelProfile
- Channel profile type:
CHANNEL_PROFILE_COMMUNICATION(0): Communication scenario. Agora recommends using the live broadcasting scenario for better audio and video experience.CHANNEL_PROFILE_LIVE_BROADCASTING(1): (Default) Live broadcasting scenario.CHANNEL_PROFILE_GAME(2): Gaming scenario. Deprecated since v4.x.x. UseCHANNEL_PROFILE_LIVE_BROADCASTINGinstead.CHANNEL_PROFILE_CLOUD_GAMING(3): Interactive scenario optimized for low latency, suitable for frequent user interactions. Deprecated since v4.x.x. UseCHANNEL_PROFILE_LIVE_BROADCASTINGinstead.
- mLicense
- License used for channel connection verification. Billing is based on the license.
- mAudioScenario
-
Note: Before using this enumeration, you must call getAudioDeviceInfo to check whether the audio device supports ultra-low-latency capture and playback. To experience ultra-low latency, ensure that the audio device supports ultra-low latency (Audio scenario type. The volume type used by the device varies in different scenarios:
isLowLatencyAudioSupported= true).AUDIO_SCENARIO_DEFAULT(0): (Default) Automatic scenario. The SDK selects the appropriate audio quality based on the user role and audio route.AUDIO_SCENARIO_GAME_STREAMING(3): High-quality audio scenario, suitable for music playback.AUDIO_SCENARIO_CHATROOM(5): Chatroom scenario, suitable for frequent role switching or microphone mute control.AUDIO_SCENARIO_CHORUS(7): Real-time chorus scenario, suitable for users with good network conditions and high requirements for ultra-low latency.AUDIO_SCENARIO_MEETING(8): Meeting scenario, mainly for transmitting voice.AUDIO_SCENARIO_AI_CLIENT(10): AI conversation scenario (AI client only), only applicable when interacting with agents created usingConversational AI Engine.
- mAutoRegisterAgoraExtensions
- Whether to automatically register Agora extensions when initializing the RtcEngine:
- true: (Default) Automatically registers extensions.
- false: Does not automatically register extensions. You must call enableExtension to register manually.
- mExtensionList
- List of extension library names.
- mExtensionObserver
- IMediaExtensionObserver instance. See IMediaExtensionObserver.
- mLogConfig
- Log configuration. See LogConfig.
By default, the SDK generates 5 SDK log files and 5 API log files:
- SDK log files include:
agorasdk.log,agorasdk.1.log,agorasdk.2.log,agorasdk.3.log,agorasdk.4.log - API log files include:
agoraapi.log,agoraapi.1.log,agoraapi.2.log,agoraapi.3.log,agoraapi.4.log - Each log file has a default size of 2048 KB and uses UTF-8 encoding.
- The SDK writes the latest logs to
agorasdk.logoragoraapi.log. - When
agorasdk.logis full, the SDK deletes old files in order and renames them to generate new log files. agoraapi.logfollows the same rollover rules.
- SDK log files include:
- mThreadPriority
- Thread priority type. See
ThreadPriorityType. - mNativeLibPath
-
Note: Applicable to manual SDK integration. Not applicable when integrating via Maven Central or JitPack. Ensure the directory exists, otherwise RtcEngine initialization will fail.Directory where
.sofiles are stored. This directory must be a valid private directory of the app and can be obtained viaContext.getDir.- After setting this parameter, the SDK loads
.sofiles from the specified directory to enable dynamic loading and reduce package size. - If not set or set to
null, the SDK loads.sofiles from the default compiled path, which increases the package size.
- After setting this parameter, the SDK loads
- mDomainLimit
- Whether to enable domain name restriction:
- true: Enables domain name restriction. Suitable for IoT devices using IoT SIM cards. The SDK only connects to domains or IPs registered in the carrier whitelist.
- false: (Default) Does not enable domain name restriction. Suitable for most general scenarios.