From a7e79ee7aec8f59ac7425061dae1cf04d6c1b5fc Mon Sep 17 00:00:00 2001 From: rohitkhirid Date: Mon, 4 Mar 2024 15:23:42 +0530 Subject: [PATCH 1/2] docs: updated android-core docs - added code samples in java and kotlin - updated in page links for objectives and their details --- docs/android-core/quickstart.mdx | 140 +++++++++++++++++++++++++------ 1 file changed, 116 insertions(+), 24 deletions(-) diff --git a/docs/android-core/quickstart.mdx b/docs/android-core/quickstart.mdx index ed1e98d45a..e7018df1a0 100644 --- a/docs/android-core/quickstart.mdx +++ b/docs/android-core/quickstart.mdx @@ -17,19 +17,17 @@ import { MavenLatestInstallation } from '@site/src/components/LatestInstallation This quickstart shows how to use Dyte's Android Core SDK to add live video and audio to your Android applications. -For getting started quickly, you can use our sample code. You can clone and run -a sample application from the -[Android Core SDK GitHub repository](https://github.com/dyte-io/android-samples/tree/main/samples/android-core-sample-kotlin). +For getting started quickly, you can use our sample code. You can clone and run a sample application from the Android Core samples either in [Kotlin](https://github.com/dyte-io/android-samples/tree/main/samples/android-core-sample-kotlin) or in [Java](https://github.com/dyte-io/android-samples/tree/main/samples/android-core-sample-java). ## Objective You'll learn how to: -- Install the Dyte SDK -- Initialize the SDK -- Configure a Dyte meeting -- Initialize the Dyte meeting -- And go live with your Dyte meeting +- [Install the Dyte SDK](#step-1-install-the-sdk-using-maven-central) +- [Initialize the SDK](#step-2-initialize-the-sdk) +- [Configure a Dyte meeting](#step-3-configure-a-dyte-meeting) +- [Initialize the Dyte meeting](#step-4-initialize-the-dyte-meeting) +- [Go live with your Dyte meeting](#step-5-go-live-with-your-dyte-meeting) ## Before Getting Started @@ -67,7 +65,6 @@ dependencies { coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4") } ``` - ::: ## Step 2: Initialize the SDK @@ -75,31 +72,72 @@ dependencies { The `DyteMobileClient` is the main class of the SDK. It is the entry point and the only class required to initialize Dyte SDK. + + + ```kotlin val dyteClient = DyteMeetingBuilder.build(activity) ``` -## Step 3: Set the meeting properties + + + +```java +DyteMobileClient dyteClient = DyteMeetingBuilder.build(activity); +``` + + + + +## Step 3: Configure a Dyte meeting Set the properties in the `DyteMeetingInfoV2` class. You just need to provide the participant's `authToken`. | Name | Description | | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -| `authToken` | After you've created the meeting, add each participant to the meeting using the [Add Participant API](/api?v=v2#/operations/add_participant) (The presetName created earlier must be passed in the body of the Add Participant API request) The API response contains the `authToken`. | | +| `authToken` | After you've created the meeting, add each participant to the meeting using the [Add Participant API](/api?v=v2#/operations/add_participant) The API response contains the `authToken`. | | +| `enableAudio` | You can control the state of audio track by passing `true` or `false` here. | | +| `enableVideo` | You can control the state of video track by passing `true` or `false` here. | | +| `baseUrl` | Base URL of the dyte's enviorment you have created the meeting on. | | + + + ```kotlin -val meetingInfo = DyteMeetingInfoV2( - authToken = "", - ) +val meetingInfo = + DyteMeetingInfoV2( + authToken = AUTH_TOKEN, + enableAudio = true, + enableVideo = true, + baseUrl = "dyte.io" + ) ``` -## Step 4: Initialize the connection request + + -To initialize the connection request, call the `init()` method obtained on +```java +DyteMeetingInfoV2 meetingInfo = new DyteMeetingInfoV2( + MeetingConfig.AUTH_TOKEN, // auth_token + true, // enableAudio + true, // enableVideo + "dyte.io" // baseUrl + ); +``` + + + + +## Step 4: Initialize the Dyte meeting + +To initialize the meeting, call the `init()` method obtained on `dyteClient` with the `meetingInfo` argument. This will establish the connection with the Dyte meeting server. + + + ```kotlin dyteClient.init(meetingInfo, { // init complete @@ -109,7 +147,24 @@ dyteClient.init(meetingInfo, { ) ``` -## Step 5: Connect to the meeting + + + +```java +dyteClient.init(meetingInfo, () -> { + // init complete + return null; + }, () -> { + // init failed + return null; + }); +``` + + + + + +## Step 5: Go live with your Dyte meeting! Now, you have established the connection with the Dyte meeting server successfully. Next step is to join the room. @@ -119,14 +174,34 @@ successfully. Next step is to join the room. To join the meeting room, call `joinRoom()` method on the `dyteClient` instance as shown below. + + + ```kotlin dyteClient.joinRoom({ - // meeting room joined -}, { - // error in joining the meeting -}) + // join complete + }, { + // join failed + } +) ``` + + + +```java +dyteClient.join(() -> { + // join complete + return null; + }, () -> { + // join failed + return null; + }); +``` + + + + ### Leave the room Once the meeting is over, you can leave the meeting room. @@ -134,6 +209,9 @@ Once the meeting is over, you can leave the meeting room. To leave the meeting room, call `leaveRoom()` method on the `dyteClient` as shown below. + + + ```kotlin dyteClient.leaveRoom({ // leave completed @@ -142,6 +220,20 @@ dyteClient.leaveRoom({ }) ``` - - Android Core Quickstart - + + + +```java +dyteClient.leave(() -> { + // leave complete + return null; + }, () -> { + // leave failed + return null; + }); +``` + + + + + From 88f9b4e57a42f7abeb5520a195b05026b3361607 Mon Sep 17 00:00:00 2001 From: rohitkhirid Date: Mon, 4 Mar 2024 17:37:03 +0530 Subject: [PATCH 2/2] chore: pr fixes --- docs/android-core/quickstart.mdx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/android-core/quickstart.mdx b/docs/android-core/quickstart.mdx index e7018df1a0..0ba94faa8b 100644 --- a/docs/android-core/quickstart.mdx +++ b/docs/android-core/quickstart.mdx @@ -17,7 +17,7 @@ import { MavenLatestInstallation } from '@site/src/components/LatestInstallation This quickstart shows how to use Dyte's Android Core SDK to add live video and audio to your Android applications. -For getting started quickly, you can use our sample code. You can clone and run a sample application from the Android Core samples either in [Kotlin](https://github.com/dyte-io/android-samples/tree/main/samples/android-core-sample-kotlin) or in [Java](https://github.com/dyte-io/android-samples/tree/main/samples/android-core-sample-java). +To get started quickly, you can use our sample code. You can clone and run a sample application from the Android Core samples, available in both [Kotlin](https://github.com/dyte-io/android-samples/tree/main/samples/android-core-sample-kotlin) and [Java](https://github.com/dyte-io/android-samples/tree/main/samples/android-core-sample-java). ## Objective @@ -91,14 +91,13 @@ DyteMobileClient dyteClient = DyteMeetingBuilder.build(activity); ## Step 3: Configure a Dyte meeting -Set the properties in the `DyteMeetingInfoV2` class. You just need to provide the -participant's `authToken`. +Configure the following properties in the `DyteMeetingInfoV2` class. You must pass a valid participant `authToken` obtained from the [Add Participant](/api/?v=v2#/operations/add_participant) API. | Name | Description | | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | | `authToken` | After you've created the meeting, add each participant to the meeting using the [Add Participant API](/api?v=v2#/operations/add_participant) The API response contains the `authToken`. | | -| `enableAudio` | You can control the state of audio track by passing `true` or `false` here. | | -| `enableVideo` | You can control the state of video track by passing `true` or `false` here. | | +| `enableAudio` | Set whether to join the meeting with your Mic ON or OFF by passing `true` or `false`. | | +| `enableVideo` | Set whether to join the meeting with your Camera ON or OFF by passing `true` or `false`. | | | `baseUrl` | Base URL of the dyte's enviorment you have created the meeting on. | | @@ -131,9 +130,7 @@ DyteMeetingInfoV2 meetingInfo = new DyteMeetingInfoV2( ## Step 4: Initialize the Dyte meeting -To initialize the meeting, call the `init()` method obtained on -`dyteClient` with the `meetingInfo` argument. This will establish the connection -with the Dyte meeting server. +To initialize the meeting, call the `init()` method on the `dyteClient` object with the `meetingInfo` argument. This establishes a connection with the Dyte meeting server.