Code sample

Updated at:

This topic provides a code sample for integrating Audio & Video Calling with Android and explains how to use it.

Download the code sample

Click here to download the Audio & Video Calling code sample.

Use the code sample

  1. Replace the configuration file in the sample project.

    1. Log on to the mPaaS console.

    2. Create an mPaaS application.

    3. Download the .config configuration file for your mPaaS application. Place it in the app/ folder of the Audio & Video Calling sample project to replace the existing configuration file.

  2. Create a call application and obtain the bizName. In the mPaaS console, navigate to Audio & Video Calling > Call Application Management from the navigation pane on the left. You can create a new call application or open an existing one to obtain its bizName.

  3. Generate a temporary signature in the console. In the mPaaS console, navigate to Audio & Video Calling > Signature Verification from the navigation pane on the left. In the Generate Temporary Signature area, select your call application and enter a UserID to generate a temporary signature.

    Note
    • You must generate a new temporary signature if you change the call application or UserID.

    • Temporary signatures expire. You must generate a new signature after the previous one expires.

  4. Configure and run the sample project. On the App Settings page, enter the user ID (userId), business name (bizName), and temporary signature (signature) that you obtained in the previous steps.

    Note

    To ensure the security of your traffic, you must generate signatures on the server-side after your application is published.

  5. Start or join an audio/video call. In the app, you can create a call channel to start an audio/video call. Alternatively, you can join an existing call by entering the channel ID (roomId) and token.

    Note

    Within the same call application (which uses the same bizName), the user IDs for different clients must be unique.