Build a Zoom meeting app


Explore the Zoom Client Android SDK by learning how to build a simple meetings app that has the following two features:

  • Join a Meeting : A user with a Zoom meeting ID and meeting passcode can join a meeting anonymously without having to log into the app.

  • Start a Meeting: A meeting host can start the meeting after logging into the app with their Zoom account credentials.

You can find an existing sample application with these features on Github.

Prerequisites

  • Android Studio

  • Android Device (Supported Devices: Phone, Tablets)
    TV, Box and Chromebooks are not supported.

  • Meeting ID and the passcode of a Zoom meeting.

  • SDK Key and Secret, obtained by creating an SDK App.

  • Android API Level: minSdkVersion 21 or higher

Note: If you select minSdkVersion 23 or higher as your minSDKVersion, you will need to reduce your app size by including: android:extractNativeLibs="true"in your AndroidManifest.xml

  1. Dependencies:
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.3.0-alpha02'
implementation 'com.google.android:flexbox:2.0.1'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"

This section of the tutorial demonstrates how to create an Android project and integrate the Zoom Client Android SDK into the project.

1. Create an Android project

Open Android Studio and click Start a new Android Studio Project. Next, on the Select a Project Template window, select Phone and Tablet > Empty Activity.

Click Next and enter your Application name, Company domain, select your Project location and Programming language in the next screen.

Select API 21: Android 5.0(Lollipop) or higher as the minimum SDK for the project and click Finish. A new project will be created for you by Android Studio.

Build and run this project on your emulator or on your device to ensure that there are no initial errors and your starter project is working.

2. Import the Zoom SDK libraries

If you have not already downloaded the Zoom Android SDK, click the following button to download it:

The downloaded folder includes SDK libraries and sample apps. The SDK libraries (aar libraries) are in the commonlib and mobilertc folders located inside the mobilertc-android studio folder. Ensure that the following files are included in these folders, if you find that any of them is missing or you delete one by mistake, re-download the SDK.

commonlib

commonlib/
├── build.gradle
├── commonlib.aar

mobilertc

mobilertc/
├── build.gradle
├── mobilertc.aar

Add modules and configure dependencies

In this step, you are going to import commonlib.aar and mobilertc.aar modules from the downloaded SDK package to your project as AAR files.In Android Studio, click File > Project Structure > Module> + > New module.

In the next screen, scroll down to select “Import .JAR/.AAR Package”, locate the aar files from the downloaded SDK package and add them into your project.

You will need to do it twice, once for commonlib.arr and once for mobilertc.arr.

Next, add these modules as dependencies of your app. Navigate to Project Structure, click Dependencies > App > + > “Module Dependency. In the next screen, select commonlib and mobilertc and click OK.

To confirm whether or not you have successfully configured the Zoom SDK dependencies, look for the build.gradle(Module:app) file inside the Gradle scripts folder and check if the following lines of code are present:

dependencies {
    implementation project(path: ':mobilertc')
    implementation project(path: ':commonlib')
}

If the above dependencies are present, your project is equipped with the Zoom Client SDK.

3. Initialize the SDK

In order to use the Zoom SDK, you need to initialize it. To do so, open your MainActivity.java file and within your onCreate method, call the initializeSDK method.

Tip: On MacOS and Windows, you can quickly navigate to a file by pressing shift twice and typing in the name of the file.

MainActivity.java
  @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // Call this method to initialize the SDK
        initializeSdk(this);   
    }

You added the initializeSDK call inside the onCreate method but you haven’t yet implemented the intializeSDK method itself. You must provide your SDK Key and Secret for the initialization of the SDK.

To implement this method, add the following code below the onCreate method:

MainActivity.Java
public void initializeSdk(Context context) {
        ZoomSDK sdk = ZoomSDK.getInstance();
        // TODO: For the purpose of this demo app, we are storing the credentials in the client app itself. However, you should not use hard-coded values for your key/secret in your app in production.
       ZoomSDKInitParams params = new ZoomSDKInitParams();
        params.appKey = ""; // TODO: Retrieve your SDK key and enter it here
        params.appSecret = ""; // TODO: Retrieve your SDK secret and enter it here
        params.domain = "zoom.us";
        params.enableLog = true;
        // TODO: Add functionality to this listener (e.g. logs for debugging)
        ZoomSDKInitializeListener listener = new ZoomSDKInitializeListener() {
            /**
             * @param errorCode {@link us.zoom.sdk.ZoomError#ZOOM_ERROR_SUCCESS} if the SDK has been initialized successfully.
             */
            @Override
            public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) { }

            @Override
            public void onZoomAuthIdentityExpired() { }
        };
        sdk.initialize(context, listener, params);

    }

At this point, your MainActivity.java file should look similar to the following:

MainActivity.java

package com.example.myfirstsdkapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import us.zoom.sdk.JoinMeetingOptions;
import us.zoom.sdk.JoinMeetingParams;
import us.zoom.sdk.MeetingService;
import us.zoom.sdk.StartMeetingOptions;
import us.zoom.sdk.ZoomSDK;
import us.zoom.sdk.ZoomSDKInitParams;
import us.zoom.sdk.ZoomSDKInitializeListener;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initializeSdk(this);

    }

public void initializeSdk(Context context) {
        ZoomSDK sdk = ZoomSDK.getInstance();
        // TODO: For the purpose of this demo app, we are storing the credentials in the client app itself. However, you should not use hard-coded values for your key/secret in your app in production.
       ZoomSDKInitParams params = new ZoomSDKInitParams();
        params.appKey = ""; // TODO: Retrieve your SDK key and enter it here
        params.appSecret = ""; // TODO: Retrieve your SDK secret and enter it here
        params.domain = "zoom.us";
        params.enableLog = true;
        // TODO: Add functionality to this listener (e.g. logs for debugging)
        ZoomSDKInitializeListener listener = new ZoomSDKInitializeListener() {
            /**
             * @param errorCode {@link us.zoom.sdk.ZoomError#ZOOM_ERROR_SUCCESS} if the SDK has been initialized successfully.
             */
            @Override
            public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) { }

            @Override
            public void onZoomAuthIdentityExpired() { }
        };
        sdk.initialize(context, listener, params);

    }

}

So far you learned how to successfully integrate the Zoom Client Android SDK in your app. Next, learn how to design the UI of this app.

Next steps: