Native SDKs
Preface
Overview
Build your first Zoom app
Techniques
Mastering Zoom SDK
1. SDK Initialization
2. Start / Join Meeting
3. In-Meeting Function
4. Other Features
SDK Reference
Resource
Get Help
Web SDK
Additional Tips
Hybrid Frameworks Support

SDK Initialization


Contents

1. Initialize the Zoom SDK

2. Log feature

Main Thread

Please note that SDK initialization and all API call must run in Main Thread.

1. Initialize the Zoom SDK

In order to have all Zoom services working, the Zoom SDK instance needs to be initialized. The ZoomSDK object exposes a generic interface to allow initialization, authentication, and configuration.

To initialize the object, first you need to implement the ZoomSDKInitializeListener in your class.

public class InitAuthSDKHelper implements AuthConstants, ZoomSDKInitializeListener {
  ...
}

Next, instantiate a ZoomSDK object by calling .getInstance(), and then .initialize().

Please do not use raw IP address as the web domain

Please do not use raw IP address as the web domain as it will cause vulnerability issues. If you would like to learn why, please see our security practices for more information.

ZoomSDK sdk = ZoomSDK.getInstance();
sdk.initialize(context, APP_KEY, APP_SECRET, (ZoomSDKInitializeListener)this);

The parameters in the function (from first to last):

Parameter Definition
Context Android context
appKey Your SDK key
appSecret Your SDK secret
listener Listener for initialize result

This function will not return anything upon successful execution.

In order to initialize SDK successfully, you need to override the following method with ZoomSDKInitializeListener implemented:

/**
 * init sdk callback
 * @param errorCode defined in {@link us.zoom.sdk.ZoomError}
 * @param internalErrorCode Zoom internal error code
 */
@Override
public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) {
  ...
}

If you receive success code from the result, you can also try to log user in automatically by calling tryAutoLoginZoom() method:

/**
 * init sdk callback
 * @param errorCode defined in {@link us.zoom.sdk.ZoomError}
 * @param internalErrorCode Zoom internal error code
 */
@Override
public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) {
  ...
    if (errorCode != ZoomError.ZOOM_ERROR_SUCCESS) {
			Toast.makeText(this, "Failed to initialize Zoom SDK. Error: " + errorCode + ", internalErrorCode=" + internalErrorCode, Toast.LENGTH_LONG).show();
		} else {
			Toast.makeText(this, "Initialize Zoom SDK successfully.", Toast.LENGTH_LONG).show();
			if (mZoomSDK.tryAutoLoginZoom() == ZoomApiError.ZOOM_API_ERROR_SUCCESS) {
        UserLoginCallback.getInstance().addListener(this);
				showProgressPanel(true);
			} else {
				showProgressPanel(false);
			}
		}
  ...
}

2. Log feature

The log feature is introduced with SDK v4.3.53571.0118, you can enable log feature when initializing Zoom SDK with the following method:

Initialize with log

ZoomSDK sdk = ZoomSDK.getInstance();
sdk.initialize(context, APP_KEY, APP_SECRET, (ZoomSDKInitializeListener)this, (enableLog)true);

Once the log feature is initialized, a log file will be created inside the path: /Android/data/(or your app's name)/logs/

Path of the log
Path of the log

The log file has a 5MB storage capacity(fixed). Once it reaches the maximum capacity, it will auto re-record from the beginning and override the previous data.