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
GitHub
Note
  • 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.

    image_20201127105738483

  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.

    image_20210302721237535

  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.

    image_20210302902369594

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

    image_20210302277124150

    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.

    /Pics/Android/ZegoWhiteboardExample/image_20210302991016025.png

  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.

    image_20210302564451783

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

    image_20210302173148802

Page Directory