Claw Machine: Client Setup

There is a new release of the Developer Center! If you'd like to check it out, please click  here

Claw Machine: Client Setup

Integrating the SDK

After integrating and configuring the Agora Wawaji SDK on the server (claw machine), you need to integrate and configure the SDK on the client. For more information, see Basic: Starting a Live Video Broadcast.

Running the Demo

The demo shows the following functionalities:

  • Join a claw machine room.
  • Switch the role from a viewer to a player.
  • Leave a claw machine room.

Step 1: Prepare the Development Environment

Prepare the following development environment:

  • Android Studio 2.0 or later.
  • An Android device. (For example, Nexus 5X. Do not use an emulator.)

Step 2: Download the Demo

Download Wawaji-Client-Android demo.

Step 3: Run the Demo

  1. Get an App ID (see Getting an App ID).
  2. Unpack the downloaded demo, and enter the acquired App ID in “app/src/main/res/values/string_config.xml”.
  3. Download Video SDK from the Agora Developer Center.
  4. Unpack the downloaded package.
  5. Open a new project on your Android Studio.
  6. Save the .jar file under the libs folder to the app/libs folder of your project.
  7. Save the arm64-v8a/x86/armeabi-v7a file under the libs folder to the app/src/main/libs folder of your project.
  8. Connect your Android device to your computer, and compile the demo before running it.

Code Snippets

Create a Media Engine

mRtcEngine = RtcEngine.create(mContext, appId, mEngineEventHandler.mRtcEventHandler);

Set the Channel Profile as Live Broadcast

mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING);

Enable the Video

mRtcEngine.enableVideo();

Set the Client Role

mRtcEngine.setClientRole(cRole, "");

Join a Channel

mRtcEngine.joinChannel(null, channel, "Wawaji", uid);

Leave a Channel

mRtcEngine.leaveChannel();
Is this page helpful?