Skip to content

Commit

Permalink
Merge pull request #343 from dyte-io/MOB-1581-android-core-restructuring
Browse files Browse the repository at this point in the history
feat: restructure android-core docs
  • Loading branch information
swapnilmadavi authored May 10, 2024
2 parents d651754 + 1ca0661 commit b3b8057
Show file tree
Hide file tree
Showing 47 changed files with 1,304 additions and 676 deletions.
42 changes: 42 additions & 0 deletions docs/android-core/Introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Introduction
sidebar_position: 3
sidebar_class_name: module-seperation
---

import ProductSection from '/docs/partials/_product-section.mdx';

# Introduction

The Dyte Core SDK is designed to provide you with an easy way to incorporate live video, voice, livestream and chat capabilities
into your Android apps. The Core SDK acts as a data-only layer. It provides simple APIs offering high-level primitives and
abstracting away complex media and networking optimizations.

## Why Core SDK?

The Core SDK was developed with a user-friendly approach to eliminate the complexity of managing streams. Unlike traditional
SDKs that require knowledge of WebRTC functioning, Dyte's Core SDK provides a simple API that abstracts out the complexity,
making it easier for developers to use. For instance, enabling video with Dyte's Core SDK is as easy as calling
`meeting.localUser.enableVideo()`.

## Utility Modules

The Core SDK includes various modules for in-call utilities like chat, polls, and recording that enable building a UI on top of
it. The following are the core SDK modules:

- **meeting.localUser**: This consists of properties and methods corresponding to the current (local) user, such as enabling or
disabling their audio and video, getting a list of media devices or changing the device, or sharing your mobile screen.
- **meeting.participants**: Use this module to get useful information about the other participants that are present in the
meeting. A host can use this module for access control. For example, the host can mute or kick a participant.
- **meeting.chat**: It provides the methods to integrate chat features such as sending/receiving text, images, and files.
- **meeting.polls**: Meetings can have polls. This module lets you perform actions related to polls, that is create and manage
a poll within a meeting.
- **meeting.recording**: When a meeting needs to be recorded, this module can be used. It lets you start or stop a recording,
and get the current status of an ongoing recording.
- **meeting.meta**: This object consists of all the metadata related to the current meeting, such as the title, the timestamp
of when it started, and more.
- **meeting.plugins**: Provides the list of available plugins and active plugins. Use this module to enable or disable plugins as needed.

<head>
<title>Android Core Introduction</title>
</head>
2 changes: 1 addition & 1 deletion docs/android-core/chat/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"position": 6,
"position": 8,
"label": "Chat",
"collapsible": true
}
46 changes: 45 additions & 1 deletion docs/android-core/chat/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
application – a step towards immersive real-time communication.
sidebar_position: 1
tags:
- mobile-core
- android-core
- chat
---

Expand All @@ -20,8 +20,52 @@ in the chat. This is an array of objects, where each object is of type
We support three types of chat messages, they are as follows

- Text Message

```kotlin
class DyteTextMessage(
userId: String,
displayName: String,
read: Boolean,
pluginId: String?,
val message: String,
time: String,
channelId: String? = null,
)
```

- Image Message

```kotlin
class DyteImageMessage(
userId: String,
displayName: String,
read: Boolean,
pluginId: String?,
val link: String,
time: String,
channelId: String? = null,
)
```

- File Message

```kotlin
class DyteFileMessage(
userId: String,
displayName: String,
read: Boolean,
pluginId: String?,
val name: String,
time: String,
val link: String,
val size: Long,
channelId: String? = null,
)
```

All above objects are of type `DyteChatMessage` along with their own class
variables.

<head>
<title>Android Core Introducing chat</title>
</head>
28 changes: 18 additions & 10 deletions docs/android-core/chat/receiving-chat-messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
Android app using Dyte
sidebar_position: 3
tags:
- mobile-core
- android-core
- chat
---

Expand All @@ -17,14 +17,22 @@ subscribe to this events by calling
`meeting.addChatEventsListener(dyteChatEventsListener)`

```kotlin
meeting.addChatEventsListener(object :
DyteChatEventsListener {
override fun onChatUpdates(messages: List<DyteChatMessage>) {
// to load chat messages
}
meeting.addChatEventsListener(object :
DyteChatEventsListener {
override fun onChatUpdates(messages: List<DyteChatMessage>) {
// to load chat messages
}

override fun onNewChatMessage(message: DyteChatMessage) {
// when a new chat message is shared in the meeting
}
})
override fun onNewChatMessage(message: DyteChatMessage) {
// when a new chat message is shared in the meeting
}
})
```

The `onChatUpdates()` method will be called whenever there is a change in the chat messages. The `messages` parameter is a list of `DyteChatMessage` objects that have been sent in the chat.

The `onNewChatMessage()` method will be called whenever a new chat message is shared in the meeting. The `message` parameter is a `DyteChatMessage` object that has been sent in the chat.

<head>
<title>Android Core Receiving chat</title>
</head>
6 changes: 5 additions & 1 deletion docs/android-core/chat/sending-a-chat-message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
with Dyte
sidebar_position: 2
tags:
- mobile-core
- android-core
- chat
---

Expand Down Expand Up @@ -42,3 +42,7 @@ val filePath = "file_path_of_image"
val fileName = "file_name"
meeting.chat.sendFileMessage(filePath, fileName)
```

<head>
<title>Android Core Sending chat</title>
</head>
36 changes: 36 additions & 0 deletions docs/android-core/error-codes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: System Error Codes
sidebar_position: 99
---

:::info Note

This information is intended for developers debugging or troubleshooting Dyte's mobile core system errors.

:::

Error codes are a standardized method for developers to convey application errors and issues to users or other developers in a structured manner. Error codes typically consist of a numerical or alphanumeric code and a description that provides more information about the error.

This document lists Dyte's Android core error codes that you may encounter in various scenarios. System error codes can arise in different parts of the system, and their descriptions may not always provide exact details. To address these codes effectively, you must first understand the programmatic and runtime contexts in which these errors occurred.

## Error codes and format

Error codes consist of a number that are categorized by the type of error and a message that provides more information about the error. The error code format is as follows:

```kotlin
class DyteError(val code: Int, val message: String)
```

### Meeting error codes

Meeting error codes are used to indicate errors that occur during meeting operations. These errors are typically returned by the methods of the `meeting` object such as `init()`, `join()`.

- 1000: Invalid auth token.
- 1002: Failed to initialize meeting.
- 1003: Invalid base URL.
- 1005: Failed to join room.
- 4000: Something went wrong.

<head>
<title>Android Core System Error Codes</title>
</head>
2 changes: 1 addition & 1 deletion docs/android-core/livestream/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"position": 7,
"position": 10,
"label": "Livestream",
"collapsible": true
}
2 changes: 1 addition & 1 deletion docs/android-core/livestream/dyte-livestream-listener.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
Listener in Dyte documentation.
sidebar_position: 3
tags:
- flutter-core
- android-core
- livestream
---

Expand Down
2 changes: 1 addition & 1 deletion docs/android-core/local-user/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"position": 3,
"position": 6,
"label": "Local User",
"collapsible": true
}
2 changes: 1 addition & 1 deletion docs/android-core/local-user/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
Dyte's documentation on Local User Events.
sidebar_position: 2
tags:
- mobile-core
- android-core
- local-user
- self
---
Expand Down
2 changes: 1 addition & 1 deletion docs/android-core/local-user/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
in Android applications.
sidebar_position: 1
tags:
- mobile-core
- android-core
- local-user
- self
---
Expand Down
2 changes: 1 addition & 1 deletion docs/android-core/local-user/manage-media-devices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Manage Media Devices
description: '"Effectively manage media devices on Android using Dyte''s documentation'
sidebar_position: 3
tags:
- web-core
- android-core
- local-user
- self
- self events
Expand Down
2 changes: 1 addition & 1 deletion docs/android-core/local-user/manage-permissions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
controlled user experience with Dyte Docs.
sidebar_position: 4
tags:
- mobile-core
- android-core
- local-user
- self
- self events
Expand Down
4 changes: 2 additions & 2 deletions docs/android-core/participants/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"position": 4,
"label": "Participants",
"position": 7,
"label": "Remote Participants",
"collapsible": true
}
Loading

0 comments on commit b3b8057

Please sign in to comment.