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 3: Run the Demo¶
- Get an App ID (see Getting an App ID).
- Unpack the downloaded demo, and enter the acquired App ID in “app/src/main/res/values/string_config.xml”.
- Download Video SDK from the Agora Developer Center.
- Unpack the downloaded package.
- Open a new project on your Android Studio.
- Save the .jar file under the libs folder to the app/libs folder of your project.
- Save the arm64-v8a/x86/armeabi-v7a file under the libs folder to the app/src/main/libs folder of your project.
- Connect your Android device to your computer, and compile the demo before running it.
Create a Media Engine¶
mRtcEngine = RtcEngine.create(mContext, appId, mEngineEventHandler.mRtcEventHandler);
Set the Channel Profile as Live Broadcast¶
Enable the Video¶
Set the Client Role¶
Join a Channel¶
mRtcEngine.joinChannel(null, channel, "Wawaji", uid);
Leave a Channel¶