Agora provides an open-source Agora-Android-Tutorial-1to1 sample project on GitHub. This document introduces how to run this project and experience a video call implemented by the Agora SDK.
To create an Agora project, do the following:
Agora automatically assigns each project an App ID as a unique identifier.
To copy this App ID, find your project on the Project Management page in Agora Console, and click the icon in the App ID column.
To ensure communication security, Agora recommends using tokens to authenticate users joining a channel.
For testing purposes, Agora Console supports generating RTC temporary tokens. To generate an RTC temporary token:
Basic-Video-Call/One-to-One-Video/Agora-Android-Tutorial-1to1sample project. Fill in the
app/src/main/res/values/strings.xmlfile with the App ID and temporary token generated in Agora Console.
// Replace <#YOUR APP ID#> with your App ID in the string format <string name="agora_app_id"><#YOUR APP ID#></string> // Replace #YOUR ACCESS TOKEN# with your temporary token in the string format <string name="agora_access_token">#YOUR ACCESS TOKEN#</string>
VideoChatViewActivity.javafile, and set
joinChannelmethod with the channel name that you use to generate the temporary token.
// Replace demoChannel1 with the channel name that you use to generate the temporary token mRtcEngine.joinChannel(token, "demoChannel1", "Extra Optional Data", 0);
Integrate the Agora Video SDK into the sample project, as follows:
Download the latest version of the Agora Video SDK and extract the files from the downloaded package.
Copy the following files or subfolders from the
libs folder of the SDK package to the corresponding folder of the sample project:
Connect the Android device to your computer, open the Agora-Android-Tutorial-1to1 sample project on Android Studio, and then build and run the project.
After the IDE successfully installs the app on your Android device, you can see the following user interface:
You have joined the demoChannel1 channel by default. If you want to experience a one-to-one video call, you can use the Agora Web demo app to interact with your Android device. Ensure that you enter the same App ID, channel name, and temporary token in the Agora Web demo app.