Collaborative Whiteboard
  • iOS
  • Android : Java
  • Web
  • Electron
  • Windows
  • macOS
  • Overview
  • SDK downloads
  • Demo app
  • Sample codes
  • Development guide
  • Quick starts
  • Use cases
  • Error codes
  • Server APIs
  • Documentation
  • Collaborative Whiteboard
  • Sample codes
Sample code
  • The sample code package is only for demonstrating the features of collaborative whiteboard and file sharing products. It can be used as a reference to assist with your development. However, the codes provided in this package haven't been rigorously tested. If you plan to use them in a production environment, make sure you conduct sufficient testing before release to avoid any potential issues that may cause losses.
  • ZEGO no longer classifies environments into production environments and testing environments. If you create your project in ZEGO Admin Console on/before 2021-11-16, refer to the Testing environment deprecation to upgrade the SDK and adjust related codes.

Run the sample code

1 Set up the development environment

Make sure your development environment meets the following requirements :

  • Android Studio 4.0 or later.
  • Android SDK 30, Android SDK Platform-Tools 30.x.x or later.
  • An Android device or emulator that is running on Android 5.0 (or later) and supports audio and video. We recommend you use a real device. If you use a real device, enable the Developer Options and USB Debugging.
  • The Android device and the development computer are connected to the internet.

2 Prerequisites

Before you begin, make sure you complete the following steps:

  1. Create a project in the ZEGO Admin Console and get the AppID and AppSign of your project. For details, see ZEGO Admin Console - Project management.

3 Run the sample code

  1. If you haven't done so already, download and install Android Studio.

  2. Open Android Studio and click Open an Existing Project.


  3. Select the Android sample code folder in the package you downloaded (refer to the sample download section at the top of this document) and click Open.


  4. The downloaded sample code package doesn't come with the required SDK packages. So you need to download them from the following links.

  1. Extract the downloaded SDK package, and copy the SDK files into the app/libs directory of the sample code project folder.


  2. Modify the file to set the value of APP_ID and APP_SIGN, which are required for initializing the SDK.


    You must use the AppID and AppSign obtained as instructed in the Prerequisites section above, and append a letter L to the value of the AppID. Otherwise, the sample code will not run correctly.


  3. Connect your Android device (make sure Developer options and USB debugging are enabled) to your development computer. Once the device is successfully connected, it will appear in the target device drop-down menu in Android Studio.


  4. Click the Run button to build and run the sample code.


Page Directory