Agora Java API Reference for Android
|
Public Member Functions | |
abstract void | addEventListener (RtmEventListener listener) |
abstract void | removeEventListener (RtmEventListener listener) |
abstract void | login (String token, ResultCallback< Void > resultCallback) |
abstract void | logout (ResultCallback< Void > resultCallback) |
abstract RtmStorage | getStorage () |
abstract RtmLock | getLock () |
abstract RtmPresence | getPresence () |
abstract RtmHistory | getHistory () |
abstract String | getErrorReason (RtmErrorCode errorCode) |
abstract void | renewToken (String token, ResultCallback< Void > resultCallback) |
abstract void | publish (String channelName, String message, PublishOptions options, ResultCallback< Void > resultCallback) |
abstract void | publish (String channelName, byte[] message, PublishOptions options, ResultCallback< Void > resultCallback) |
abstract void | subscribe (String channelName, SubscribeOptions options, ResultCallback< Void > resultCallback) |
abstract void | unsubscribe (String channelName, ResultCallback< Void > resultCallback) |
abstract RtmErrorCode | setParameters (String parameters) |
abstract StreamChannel | createStreamChannel (String channelName) throws Exception |
Static Public Member Functions | |
static synchronized RtmClient | create (RtmConfig config) throws Exception |
static synchronized RtmClient | getInstance () |
static synchronized void | release () |
static String | getVersion () |
Protected Member Functions | |
abstract RtmErrorCode | initialize (RtmConfig config) |
abstract RtmErrorCode | releaseClient () |
The RtmClient class.
This class provides the main methods that can be invoked by your app.
RtmClient is the basic interface class of the Agora RTM SDK. Creating an RtmClient object and then calling the methods of this object enables you to use Agora RTM SDK's functionality.
|
static |
Create rtm client instance.
If | error occurs |
|
static |
|
static |
Release the rtm client instance.
|
static |
Get the version info of the Agora RTM SDK.
|
abstract |
Adds an event listener for receiving rtm events.
Note: The listener must implement the RtmEventListener interface or use RtmEventListener default implements if do not care about some event.
listener | the RtmEventListener object to be added |
|
abstract |
Remove the specified event listener.
Note: By removing the event listener, the listener will no longer receive notifications from rtm client.
listener | The event specified listener object |
|
abstract |
Login the Agora RTM service.
token | Token used to login RTM service. |
resultCallback | A ResultCallback object.
|
|
abstract |
Logout the Agora RTM service.
resultCallback | A ResultCallback object.
|
|
abstract |
Get the storage instance.
|
abstract |
Get the lock instance.
|
abstract |
Get the presence instance.
|
abstract |
Get the history instance.
|
abstract |
Convert error code to error string.
errorCode | Received error code |
|
abstract |
Renews the token. Once a token is enabled and used, it expires after a certain period of time. You should generate a new token on your server, call this method to renew it.
token | The new token |
resultCallback | A ResultCallback object.
|
|
abstract |
Publish a string message in the channel.
channelName | The name of the channel. |
message | The content of the string message. |
options | The options of the message. |
resultCallback | A ResultCallback object.
|
|
abstract |
Publish a binary message in the channel.
channelName | The name of the channel. |
message | The content of the string message. |
options | The options of the message. |
resultCallback | A ResultCallback object.
|
|
abstract |
Subscribe a channel.
channelName | The name of the channel. |
options | The options of subscribe the channel. |
resultCallback | A ResultCallback object.
|
|
abstract |
Unsubscribe a channel.
channelName | The name of the channel. |
resultCallback | A ResultCallback object.
|
|
abstract |
Set parameters of the sdk or engine
parameters | The parameters in json format |
|
abstract |
Create a stream channel instance.
channelName | The Name of the channel. |
If | error occurs |