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
long | getNativeHandle ()
void | initMediaEngine (AsyncCallback callBack) throws RteException
void | getConfigs (Config config) throws RteException
void | setConfigs (Config config) throws RteException
void | registerObserver (Observer observer) throws RteException
void | unregisterObserver (Observer observer) throws RteException

## Static Public Member Functions
static synchronized Rte | getFromBridge () throws RteException

## 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

Create an Rte object from the rtc bridge. Used in scenarios where the rtc engine has already been initialized, which can save the operation of initializing the rte engine.

Since
  v4.4.0

Exceptions

  RteException | RteException.errorCode() may return the following ErrorCode: ErrorCode.INVALID_OPERATION: Indicates that the rtc engine instance has not been created or the rtc engine has not been initialized. Unable to bridge rte from rtc engine.

Returns
  Rte object. If the Rte object is invalid, subsequent operations on Rte will return an error.

## ◆ destroy()

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

Destroy the Rte object. The operation will release all resources used by the Rte object.

Since
  v4.4.0

Exceptions

  RteException | RteException.errorCode() may return the following ErrorCode: ErrorCode.INVALID_OPERATION: The corresponding internal Rte object has already been destroyed or is invalid.

Returns
  void

## ◆ initMediaEngine()

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

Initialize the engine.

Since
  v4.4.0

Parameters

  callBack | Asynchronous callback function that returns the result of engine initialization.
  error | Possible ErrorCode returns: ErrorCode.OK: Success ErrorCode.DEFAULT: Engine initialization failed, specific error reason can be obtained through Error.Message(). ErrorCode.INVALID_OPERATION: Rte object created through GetFromBridge, initialization is not allowed.

Exceptions

  RteException | RteException.errorCode() may return the following ErrorCode: ErrorCode.DEFAULT: Engine initialization failed, specific error description can be obtained through RteException.getMessage(). ErrorCode.INVALID_OPERATION: The corresponding internal Rte object has been destroyed or is invalid.

Returns
  void

## ◆ getConfigs()

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

Get the configuration of Rte object.

Since
  v4.4.0

Parameters

  config | The object used to get the rte config configuration.

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 passed config object is null.

Returns
  void

## ◆ setConfigs()

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

Configure the Rte object.

Since
  v4.4.0

Parameters

  config | The object used to set the rte config configuration.

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 passed config object is null.

Returns
  void

## ◆ registerObserver()

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

Register 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 registered observer object is null.

Returns
  void

## ◆ 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