Rte

The fundamental interface class of the RTE API, which provides major methods for enabling real-time audio video interaction.

destroy

Destroys an RTE object.

public synchronized void destroy() throws RteException;
Since
v4.5.0

This method releases all resources used by the RTE object.

Restrictions

None.

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.

getAppId

Gets the App ID you set.

public String getAppId() throws RteException;
Since
v4.5.0

Restrictions

None.

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.

getConfigs [1/3]

Gets the configuration of the RTE object.

public void getConfigs(Config config) throws RteException;
Since
v4.5.0

Call timing

Call this method after Rte.

Restrictions

None.

Parameters

config
Configurations of the RTE object: Config.

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.

GetFromBridge

Bridges an RTE object from RtcEngine.

public static synchronized Rte getFromBridge() throws RteException;
Since
v4.5.0

The RTE object created by calling this method does not need to be initialized again using initMediaEngine. If you have not created and initialized the RTC engine before, you can first call Rte to create an RTE object, and then call initMediaEngine to initialize it.

Call timing

Before calling this method, ensure that you have initialized the RTC engine using create [2/2].

Restrictions

None.

Returns

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.

getJsonParameter

Gets the SDK JSON configuration that has been set.

public String getJsonParameter() throws RteException;
Since
v4.5.0

After you call setJsonParameter to set JSON configuration, you can call this method to get the configured information.

Call timing

Call this method after getConfigs [1/3].

Restrictions

None.

Returns

The JSON configuration you set.

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.

initMediaEngine

Initializes the RTE engine.

public void initMediaEngine(AsyncCallback callBack) throws RteException;
Since
v4.5.0

This method is asynchronous, which means that the result of initialization is returned through a callback.

Call timing

Call this method after the intializing the RTE object and setting the App ID.

Restrictions

None.

Parameters

callback
An asynchronous callback, which is used to return the initialization result. See AsyncCallback.
The error information during initialization: Error. When initializing the RTE engine using initMediaEngine, if errors that can be instantly detected occur, such as an invalid parameter or insufficient resource, the SDK synchronizes the error information in this parameter.

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.

Rte

Constructs an RTE object.

public Rte(InitialConfig initialConfig);
Since
v4.5.0

The RTE object manages the internal resources of Rte.

Call timing

Call this method before initMediaEngine.

Restrictions

None.

Parameters

initialConfigç
The initial configuration. Set it to null.

setAppId

Sets an App ID.

public void setAppId(String appId) throws RteException;
Since
v4.5.0

Call timing

Call this method after initMediaEngine.

Restrictions

None.

Parameters

appId
Your project's App ID, which can be obtained from Agora Console.

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.

setConfigs [1/3]

Configures the RTE object.

public void setConfigs(Config config) throws RteException;
Since
v4.5.0

You can use this method to set information such as the App ID.

Call timing

Call this method after Rte.

Restrictions

None.

Parameters

config
Configurations of the RTE object: Config.

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.

setJsonParameter

Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.

public void setJsonParameter(String jsonParameter) throws RteException;
Since
v4.5.0

Applicable scenarios

When you need to set private parameters or use custom features, you can call this method.

Call timing

Call this method after setConfigs [1/3].

Restrictions

None.

Parameters

jsonParameter
Pointer to the set parameters in a JSON string.

Exception

If the method call fails, the SDK throws RteException and returns an error message. You need to catch the exception and handle it.