This topic describes how to run the Android demo.
Prerequisites
Obtain the authentication information from the console. For more information, see Console user guide.
The token obtained from the console is for development and testing only. Using this token in a production environment poses security risks. Set up your own server to generate tokens and use the HTTPS protocol. For more information, see Generate a token on the server-side.
Environment requirements
Type |
Description |
Terminal device |
A physical Android device. |
System Version |
Android 5.0 or later. |
Procedure
Download and decompress the software development kit (SDK) and the sample code. For the download link, see SDK download.
Copy the SDK files to the Android/SDK folder in the sample code.
Open the DingApplication.java file in BasicVideoCall and configure the authentication information.
public static final String APP_ID = ; // The application ID. public static final String TOKEN = ; // The token for channel authentication. public static final String GSLB_SERVER = ; // The GSLB server address. This parameter is optional.Run the demo.
After the demo starts, enter the Channel ID, User ID, and User Name on the main interface. Then, click JOIN CHANNEL to join the channel.
After you join the channel, a preview of your local video stream appears in the large view.
When another user joins the same channel, the application automatically subscribes to their video and audio streams. The large view prioritizes the remote video stream, and the local preview stream switches to a small view. You can press and hold the small view to swap it with the large view.