Making a Voice Call

Making a Voice Call

This page demonstrates the following functions with the Agora sample code Agora-Android-Voice-Tutorial-1to1:

  • Create and join a channel
  • Make a one-to-one voice call
  • Mute the call
  • Enable the speakerphone

Step 1: Download the Sample Code

Download the latest Voice SDK.

./libs Required Libraries
./samples Agora-Android-Voice-Tutorial-1to1 Sample Code

Step 2: Prepare the Environments

Prepare the following environments:

  • Android SDK API Level 16 or later
  • Android Studio 2.0 or later
  • Android 4.1 and later devices with audio and video functionalities
  • Get an App ID

Step 3: Make a Voice Call

To make a voice call with the Agora-Android-Voice-Tutorial-1to1 sample code in the Android Voice package:

Compile the Sample Code

  1. Select Import project (Eclipse ADT, Gradle, etc.) in Android Studio.
  2. Import build.gradle using the import function of Android Studio.
../_images/android-demo-voice-2.png
  1. Enter your App ID in Agora-Android-Voice-Tutorial-1to1/app/res/values/src/strings.xml.
../_images/android-demo-voice-3.png
  1. Click the Run button to compile the sample code with an Android device connected.

Run the Sample Code

You need two phones to run the sample code for a voice call. Open the compiled app on each Android device. The following screen displays:

../_images/android-demo-voice-4.png

You can press the buttons on the screen to mute/unmute yourself or enable the speaker.