Agora Java API Reference for Android

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
io.agora.rte.Rte Class Reference

## Public Member Functions
| Rte (InitialConfig initialConfig)
synchronized void | destroy () throws RteException
| Destroys the `RTE` object. More...
long | getNativeHandle ()
void | initMediaEngine (AsyncCallback callBack) throws RteException
| Initializes the RTE engine. More...
void | getConfigs (Config config) throws RteException
| Gets the configuration information of the `Rte` object. More...
void | setConfigs (Config config) throws RteException
| Configures the information of the `RTE` object. More...
void | registerObserver (Observer observer) throws RteException
| Constructs an `RTE` object. More...
void | unregisterObserver (Observer observer) throws RteException

## Static Public Member Functions
static synchronized Rte | getFromBridge () throws RteException
| Bridges an RTE object from the `RtcEngine`. More...

## Static Public Attributes
static final String | TAG = "Rte"

## Protected Member Functions
void | finalize ()

## Detailed Description

The Rte class, which is the basic interface of the Agora Real Time Engagement SDK.

Since
  v4.4.0

## Member Function Documentation

## ◆ getFromBridge()

static synchronized Rte io.agora.rte.Rte.getFromBridge | ( |  | ) | throws RteException
| static

Bridges an RTE object from the `RtcEngine`.

Since
  v4.4.0

The RTE object created by calling this method does not require initialization through `initMediaEngine`. If you have not previously created and initialized the RTC engine, you can first call `Rte` to create an RTE object, and then call `initMediaEngine` for initialization.
Call timing: Before calling this method, make sure you have called `create(RtcEngineConfig config)` to initialize the RTC engine.

Exceptions

  RteException | If the method call fails, the SDK throws an `RteException` and returns the corresponding error information. You need to catch and handle the exception.

## ◆ destroy()

synchronized void io.agora.rte.Rte.destroy | ( |  | ) | throws RteException

Destroys the `RTE` object.

Since
  v4.4.0

This method releases all resources used by the `RTE` object.

## ◆ initMediaEngine()

void io.agora.rte.Rte.initMediaEngine | ( | AsyncCallback | callBack | ) | throws RteException

Initializes the RTE engine.

Since
  v4.4.0

This method is asynchronous and returns the initialization result through a callback function. Call timing: You need to call this method after creating the RTE object and setting the App ID.

Parameters

  callback | An asynchronous callback function used to return the engine initialization result. See `AsyncCallback` for details.

## ◆ getConfigs()

void io.agora.rte.Rte.getConfigs | ( | Config | config | ) | throws RteException

Gets the configuration information of the `Rte` object.

Since
  v4.4.0

Call timing: This method must be called after `Rte`.

Parameters

  config | The settings of the `Rte` object. See `Config` for details.

Exceptions

  RteException | If the method call fails, the SDK throws a `RteException` and returns the corresponding error information. You need to catch and handle the exception.

## ◆ setConfigs()

void io.agora.rte.Rte.setConfigs | ( | Config | config | ) | throws RteException

Configures the information of the `RTE` object.

Since
  v4.4.0

You can call this method to set the App ID and other information.
Call timing: This method must be called after `Rte`.

Parameters

  config | Settings for the `RTE` object. See `Config` for details.

Exceptions

  RteException | If the method call fails, the SDK throws an `RteException` and returns the corresponding error information. You need to catch and handle the exception.

## ◆ registerObserver()

void io.agora.rte.Rte.registerObserver | ( | Observer | observer | ) | throws RteException

Constructs an `RTE` object.

Since
  v4.4.0

The `RTE` object is used to organize and manage internal resources of `Rte`. Call timing: You must call this method before `initMediaEngine`.

Parameters

  initialConfig | Initialization settings. You can currently pass in null.

## ◆ unregisterObserver()

void io.agora.rte.Rte.unregisterObserver | ( | Observer | observer | ) | throws RteException

Unregister an rte observer.

Since
  v4.4.0

Parameters

  observer | The object that observes rte callback events.

Exceptions

  RteException | RteException.errorCode() may return the following ErrorCode: ErrorCode.INVALID_OPERATION: The corresponding internal Rte object has been destroyed or is invalid. ErrorCode.INVALID_ARGUMENT: The observer object to be unregistered is null.

Returns
  void