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
  • Quick starts
  • Integration

Integrate the SDK

Last updated:2022-09-16 18:39

1 Set up the development environment

Make sure your development environment meets the following requirements:

  • Android Studio 4.0 or later.
  • An Android device or emulator running Android 5.0 or later. We recommend you use a real device.
  • The Android device is connected to the internet.

2 Prerequisites

  • The ZegoWhiteboardView SDK needs to be used together with the ZEGO Express-Video SDK (with whiteboard support), so you also need to integrate the ZEGO Express-Video SDK (with whiteboard support) into your project. For the detailed integration instructions, see ZEGO Express-Video SDK - Integration.

    • The SDK package provided on the Whiteboard SDK downloads page already includes the ZEGO Express-Video SDK (with whiteboard support), so you don't need to download it separately.

    • If you have already integrated the ZEGO Express-Video SDK into your project before, you need to remove the old SDK and integrate the SDKs that you download from the Whiteboard SDK downloads page to avoid version mismatch between the ZEGO Express-Video SDK and the ZegoWhiteboardView SDK.

  • If you need the file sharing feature, also download the ZegoDocsView SDK.

  • 3 Integrated SDK

    3.1 Optional: Create a new project

    Skip this step if you already have a project.
    1. Launch Android Studio, and in the Welcome to Android Studio window, click Create New Project.

      android_studio_welcome.png

      If you have a project already opened, select File > New > New Project.

      new_project.png

    2. Select the project type Empty Activity.

      new_project_1.png

    3. In the Configure your project window, fill in the project name and the location to save the project.

      new_project_5.png

    4. Click Finish to complete the creation of the new project.

    3.2 Import the SDK

    ZegoWhiteboardView SDK is built with AndroidX, so your project into which you are importing the SDK also needs to use AndroidX. If your project currently doesn't use AndroidX, you can migrate it to AndroidX as instructed in Migrating to AndroidX.

    1. Download the latest version of the SDKs from the Whiteboard SDK downloads page.

    2. Extract files from the downloaded SDK package and copy the zegowhiteboardview.aar file to the app/libs/ folder in your project.

    3. Add the following line in the dependencies block of your app/build.gradle file:

      implementation fileTree(include: ['*.jar','*.aar'], dir:'libs')
    4. If your project is a pure Java project, add the following line in the dependencies block of your app/build.gradle file as well:

      // Add the following dependency if your project is a pure Java project.
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.30" // the jdk8 version can change over time.

    4 Add app permissions

    Add the following permissions in your app/AndroidManifest.xml file:

        <!-- Permissions required by the SDK -->
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    The following table gives more detailed information about these permissions:

    Permission Description Necessity Why required
    INTERNET Allows applications to open network sockets. Necessary The fundamental features of the SDK can only be functional when connected to the Internet.
    ACCESS_WIFI_STATE Allows applications to access information about Wi-Fi networks. Necessary The SDK performs different actions according to the network connection status. For example, when the network connection resumes after being interrupted, the SDK's internal state also returns to the point just before the network disconnection.
    ACCESS_NETWORK_STATE Allows applications to access information about networks. Necessary The SDK performs different actions according to the network connection status. For example, when the network connection resumes after being interrupted, the SDK's internal state also returns to the point just before the network disconnection.
    WRITE_EXTERNAL_STORAGE Allows an application to write to external storage. Necessary If you need to use a media player or sound player to load media resource files in Android external storage, you need to apply for this permission, otherwise the SDK cannot load the resources.
    READ_EXTERNAL_STORAGE Allows an application to read from external storage. Necessary SDK needs to save logs and related configuration files to the built-in SD card.

    5 Prevent code obfuscation

    Add the following line to your proguard-rules.pro file to prevent the public class names of the SDK from being obfuscated.

    -keep class im.zego.zegowhiteboard.**{*;}
    Page Directory