# Video SDK UI Toolkit 1.0 for Android

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

> Zoom Video SDK UI Toolkit is in a public beta. [Share your feedback](https://zoom.sjc1.qualtrics.com/jfe/form/SV_3NMYztWpWzNVSiG) with us, and leverage the [beta FAQ](#beta-faq) for details.

The Zoom Video SDK UI Toolkit is a prebuilt video chat user interface powered by the Zoom Video SDK.

## Prerequisites

-   Android Studio
-   An Android device with API 24+
-   A [Build platform account](/docs/build/account/) with credentials

## Install

Add the Zoom Video SDK UI Toolkit through Maven Central.

```groovy
implementation 'us.zoom.uitoolkit:uitoolkit:<VERSION>'
```

Add the version number in place of `<VERSION>`.

## Add required app permissions

In order for the camera and mic to work during the session, add the following:

| Permission Required | Optional | Description        |
| ------------------- | -------- | ------------------ |
| Camera              | Required | Required for Video |
| Microphone          | Required | Required for Audio |

## Use the UI Toolkit in your project

Follow these steps to add the toolkit to your app.

1. Add the toolkit to your layout and ability to join a session.
2. Get your authorization credentials.
3. Create the UI Toolkit and add it to your layout.
4. Create the session data.
5. Listen for callbacks.

### Get your authorization credentials

Learn how to use your credentials to [authorize](/docs/video-sdk/auth/) the SDK so you can connect.

> See the [Video SDK Auth Endpoint Sample](https://github.com/zoom/videosdk-sample-signature-node.js) for a sample app that shows how to quickly, easily, and securely generate a Video SDK JWT.

### Create the UiToolkitView and add it to your layout

Create the `UiToolkitView` that takes in the `sessionContext`. The `sessionContext` is the class defined by the UI Toolkit which contains information about joining the session.

```kotlin
val uiToolkitView = UiToolkitView(context)
```

```java
UiToolkitView uiToolkitView = new UiToolkitView(context);
```

Add with an XML element.

```xml
<us.zoom.uitoolkit.UiToolkitView
  android:id="@+id/ui_toolkit_view"
  android:layout_width="match_parent"
  android:layout_height="match_parent"/>
```

### Create the session data

Create the `SessionContext` that takes in required parameters such as JWT, session name and username (display name). See [Generate a Video SDK JWT](/docs/video-sdk/auth/#generate-a-video-sdk-jwt) for more information.

```kotlin
val sessionContext = SessionContext(sessionName, jwt, username, password)
uiToolkitView.joinSession(sessionContext)
```

```java
SessionContext sessionContext = new SessionContext(sessionName, jwt, username, password);
uiToolkitView.joinSession(sessionContext);
```

### Listen for callbacks

To listen for key events when the `UiToolkitView` starts, stops, or encounters an error, implement an anonymous inner class and pass it into `addListener`.

```kotlin
val listener = object : UiToolkit.Listener {
  override fun onViewStarted = Unit
  override fun onViewStopped = Unit
  override fun onError(error: UiToolkitError) = Unit
}

uiToolkitView.addListener(listener)
```

```java
UiToolkit.Listener listener = new UiToolkit.Listener() {
  @Override
  public void onViewStarted() {}

  @Override
  public void onViewStopped() {}

  @Override
  public void onError(UiToolkitError error) {}
};
uiToolkitView.addListner(listener);
```

## Add screen sharing

To support sending screen share, there are new methods in the SDK. When the someone clicks the share button, the SDK emits the `onShareClicked` callback. Upon receiving this callback, you can retrieve a screen capture intent through the OS. See the Android developer documentation for details on how to handle the [`createScreenCaptureIntent`](<https://developer.android.com/reference/android/media/projection/MediaProjectionManager#createScreenCaptureIntent()>) method.

After you get the `createScreenCaptureIntent`, it is passed into `onMediaProjectionResult` in the UI Toolkit.

See the [Video SDK screen sharing](/docs/video-sdk/android/share/) documentation or [the sample app](/docs/video-sdk/android/get-started/#run-the-sample-app) for more context.

## Beta FAQ

### What is the goal of this beta?

Before we make this generally available, we want to get [feedback on the complete experience](https://zoom.sjc1.qualtrics.com/jfe/form/SV_3NMYztWpWzNVSiG), such as getting started, documentation, running the UI Toolkit, troubleshooting, and more.
