Public Member Functions | |
abstract void | release () |
abstract void | login (@Nullable String token, @NonNull String userId, @Nullable ResultCallback< Void > resultCallback) |
abstract void | logout (@Nullable ResultCallback< Void > resultCallback) |
abstract RtmMessage | createMessage () |
abstract void | sendMessageToPeer (@NonNull String peerId, @NonNull RtmMessage message, @Nullable ResultCallback< Void > resultCallback) |
abstract RtmChannel | createChannel (@NonNull String channelId, @NonNull RtmChannelListener channelListener) throws RuntimeException |
abstract RtmCallManager | getRtmCallManager () |
abstract int | setParameters (String parameters) |
abstract int | setLogFile (String filePath) |
abstract int | setLogFilter (int filter) |
Static Public Member Functions | |
static RtmClient | createInstance (@NonNull Context context, @NonNull String appId, @NonNull RtmClientListener eventListener) throws Exception |
Static Public Attributes | |
static final int | LOG_FILTER_OFF = 0 |
static final int | LOG_FILTER_DEBUG = 0x80f |
static final int | LOG_FILTER_INFO = 0x0f |
static final int | LOG_FILTER_WARNING = 0x0e |
static final int | LOG_FILTER_ERROR = 0x0c |
static final int | LOG_FILTER_CRITICAL = 0x08 |
The entry point of the Agora RTM SDK.
|
static |
Creates an RtmClient instance.
The Agora RTM SDK supports creating multiple RtmClient instances.
All methods in the RtmClient class are executed asynchronously.
context | The context of Android Activity. |
appId | The App ID issued to you from the Agora Dashboard. Apply for a new App ID from Agora if it is missing from your kit. |
eventListener | An RtmClientListener object that reports to the app on RTM SDK runtime events. |
Exception | Returns an exception if appId is invalid (for example, its length is not 32 characters), or context or eventListener is null. |
|
abstract |
Releases all resources used by the RtmClient instance.
Note: Do not call this method in any of your callbacks.
|
abstract |
Allows a user to log in the Agora RTM system.
Note: If you log in with the same user ID from a different instance, you will be kicked out of your previous login and removed from previously joined channels.
token | The token used to log in the Agora RTM system and used when dynamic authentication is enabled. Set token as null in the integration and test stages. |
userId | The user ID of the user logging in the Agora RTM system. The string length must be less than 64 bytes with the following character scope:
|
Note: userId
cannot be empty or set as null.
resultCallback | A ResultCallback object.
|
|
abstract |
Allows a user to log out of the Agora RTM system.
resultCallback | A ResultCallback object.
|
|
abstract |
Creates an RtmMessage instance.
Note: The RtmMessage instance can be either for a channel message or for a peer-to-peer message.
|
abstract |
Allows the local user to send a peer-to-peer message to a specific remote user.
You can send messages, including peer-to-peer and channel messages, at a maximum speed of 60 queries per second.
Success:
Failure: The local user receives the onFailure callback with an error. See PeerMessageError for the error codes.
peerId | The user ID of the remote user. |
message | The message to be sent. For information about creating a message, see RtmMessage. |
resultCallback | A ResultCallback object.
|
|
abstract |
Creates an Agora RTM channel.
Note: You can create a maximum of 20 RtmChannel instances in an RtmClient instance at the same time. You must call the RtmChannel.release() method to release the resources of some existing RtmChannel instances when the number of channels is over 20, otherwise the sytem will crash and throw runtime exceptions. You can of course call the RtmClient.release() method to relase all resources used by the RtmClient, but we recommend that you not rely on the SDK to release an RtmChannel.
channelId | The unique channel name for the Agora RTM session. The string length must be less than 64 bytes with the following character scope:
|
Note: Do not set channelId
as null.
channelListener | An RtmChannelListener object.
|
RuntimeException | in any of the cases below:
|
|
abstract |
Gets the Agora RTM call manager.
The Agora SDK has one RtmCallManager instance for each RtmClient instance. Different RtmClient instances have different RtmCallManager instances.
|
abstract |
Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way.
parameters | The parameter to set as a JSON string in the specified format. |
|
abstract |
Specifies an SDK output log file.
The log file records all SDK operations during SDK runtime. Ensure that the log file exists and is writable.
filePath | The file path of the log file. The string of the log file is in UTF-8. The default file path is /sdcard/{Package name of the App}/agorartm.log. |
|
abstract |
Sets the output log level of the SDK.
You can use one or a combination of the filters. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level. For example, if you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING.
filter | Sets the log filter level:
|
|
static |
0: Do not output any log.
|
static |
0x80f: Output all API logs.
|
static |
0x0f: Output logs of the CRITICAL, ERROR, WARNING, and INFO levels.
|
static |
0x0e: Output logs of the CRITICAL, ERROR, and WARNING levels.
|
static |
0x0c: Output logs of the CRITICAL and ERROR levels.
|
static |
0x08: Output logs of the CRITICAL level.