Skip to content

Commit

Permalink
Refactor docs (#5154)
Browse files Browse the repository at this point in the history
First iteration (restructure & cookbook)
  • Loading branch information
liviu-timar authored Feb 23, 2024
1 parent 9aa6608 commit e322037
Show file tree
Hide file tree
Showing 407 changed files with 24,364 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ object Dependencies {
const val composeActivity = "androidx.activity:activity-compose:${Versions.ANDROIDX_ACTIVITY_COMPOSE}"
const val composeViewModel = "androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.ANDROIDX_LIFECYCLE}"
const val composeStableMarker = "com.github.skydoves:compose-stable-marker:${Versions.COMPOSE_STABLE_MARKER}"
const val composeLifecycle = "androidx.lifecycle:lifecycle-runtime-compose:${Versions.ANDROIDX_LIFECYCLE}"
const val coroutinesAndroid = "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.COROUTINES}"
const val coroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.COROUTINES}"
const val coroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.COROUTINES}"
Expand Down Expand Up @@ -191,6 +192,7 @@ object Dependencies {
const val navigationRuntimeKTX = "androidx.navigation:navigation-runtime-ktx:${Versions.ANDROIDX_NAVIGATION}"
const val navigationTest = "androidx.navigation:navigation-testing:${Versions.ANDROIDX_NAVIGATION}"
const val navigationUIKTX = "androidx.navigation:navigation-ui-ktx:${Versions.ANDROIDX_NAVIGATION}"
const val navigationCompose = "androidx.navigation:navigation-compose:${Versions.ANDROIDX_NAVIGATION}"
const val ok2curl = "com.github.mrmike:ok2curl:${Versions.OK2CURL}"
const val okhttp = "com.squareup.okhttp3:okhttp:${Versions.OKHTTP}"
const val okhttpLoggingInterceptor = "com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}"
Expand Down
5 changes: 5 additions & 0 deletions docusaurus/android-docusaurus-dontent-docs.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ module.exports = {
path: 'v5',
banner: 'unmaintained'
},
'draft': {
label: 'Draft',
path: 'draft',
banner: 'unreleased'
},
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
slug: /
---

# Overview

The [Stream Chat Android SDK](https://github.com/GetStream/stream-chat-android) enables you to easily build any type of chat or messaging experience for Android, either in Kotlin or Java.

:::note
The fastest way to get started with the SDK is by trying the [Android Views In-App Messaging Tutorial](https://getstream.io/tutorials/android-chat/). If you're using Jetpack Compose, see the [Compose In-App Messaging Tutorial](https://getstream.io/chat/compose/tutorial/) instead.
:::

## Architecture

The SDK consists of five major components:
- [Views/XML UI components](../02-ui-components/01-getting-started.mdx). Provides a set of reusable and customizable UI components based on Android Views.
- [Compose UI components](../03-compose/01-overview.mdx). Provides a set of reusable and customizable Jetpack Compose UI components.
- [Low-level client](https://getstream.io/chat/docs/android/?language=kotlin). Provides the main chat functionality. You can use it directly if you intend to build your own UI layer for the chat.
- [State](../05-state-and-offline/01-state-overview.mdx). Plugin that gives you the possibility to observe data via `StateFlows`. It exposes `StateFlow` objects containing the loading state, channel and message lists, channel members, users that are typing and more.
- [Offline Support](../05-state-and-offline/02-offline-support.mdx). Plugin that enables offline data and actions, like cached channels, messages, sending messages and reactions. Good for improving UX when the network connection is poor.

We recommend using either the [Views/XML UI Components](../02-ui-components/01-getting-started.mdx) or the [Compose UI Components](../03-compose/01-overview.mdx) to most of our customers. If your UI doesn't significantly differ from the industry standard, you should be able to customize the built-in components to match your requirements.

For more information about including each component in your project, see the [Installation](02-installation.mdx) page.

## UI SDKs

Built on top of the Stream Chat low-level client, the Stream Chat Android UI components enable you to easily build any type of chat or messaging experience for Android.

We have UI component libraries available for both **Android Views** and **Jetpack Compose**. Each of these libraries provides an extensive collection of efficient and customizable UI components which enable you to quickly get started with little to no setup required. The libraries support:

- Rich-media messages
- Channel and message lists
- Message Reactions
- Message threads and quoted replies
- Text input commands (ex: Giphy and @mentions)
- Image and file uploads
- Video playback
- Indicators for read state and typing
- Push notifications
- Offline storage
- Voice messages (only in the Android Views library for now)
- and more.

If needed, you can create your own UI components by listening to the state we expose and using our components as building blocks. You can learn more about how state is exposed [here](../08-client/06-guides/04-state-plugin.mdx) and in the [low-level client docs](https://getstream.io/chat/docs/android/?language=kotlin).

### Choosing the Right UI SDK

#### Views UI Components

The UI Components library includes pre-built Android Views to easily load and display data from the Stream Chat API. These include a Channel List and a Message List, a Message Composer View, and more. See the [Getting Started](../02-ui-components/01-getting-started.mdx) page for more details.

This library is built on top of the state library, and offers the quickest integration of Stream Chat into an Android application. It also offers a variety of [theming](../02-ui-components/02-theming.mdx) options to make it fit your app's needs.

You can see the UI Components in action by checking out the [UI Components Sample App](https://github.com/GetStream/stream-chat-android/tree/main/stream-chat-android-ui-components-sample), available in the GitHub repository.

#### Compose UI Components

The Compose UI Components library is a chat UI implementation built from scratch with [Jetpack Compose](https://developer.android.com/jetpack/compose). It contains modular Composable functions for building channel lists, messaging screens, and more. See the [Getting Started](../03-compose/01-overview.mdx) page for more details.

This is also built on top of the state library, and offers easy integration of Stream Chat into a Compose-based Android application. It's also highly modular and customizable.

Check out the Compose implementation in action by trying the open-source [Compose UI Components Sample App](https://github.com/GetStream/stream-chat-android/tree/main/stream-chat-android-compose-sample).

:::note
Using our Compose SDK in an Android Views based app is fully supported. It could provide you an amazing opportunity to explore and adopt Compose.
:::

#### The Right SDK for You

If your use case requires a very high level of customization, runtime theming changes, replacing whole parts of the default UI or stateless components that don't rely on our ViewModels,
the **Compose SDK is the way to go**. It offers deep customization through several layers - the theme, modifiers for components, bound and stateless component overloads, smaller reusable components and slot APIs.

If, instead, you're looking for a simpler, less customizable SDK which currently offers slightly better performance in some scenarios or your project is limited by technology, then
the **UI Components SDK is a great option**. It still offers a fair amount of customization through the theme and its attributes and some programmatic ways to customize the UI.

Whichever SDK you choose, **we guarantee you'll be happy and we'll provide amazing support** with your integration, through detailed documentation, guides and direct support.

## Upgrade and Versioning Strategy

Our Android libraries do **not** follow semantic versioning.

We increase the minor version whenever breaking changes are introduced. Patch releases only contain smaller fixes and improvements.

You can see all the SDK changes in the [releases page](https://github.com/GetStream/stream-chat-android/releases), and you can also find the release notes of all past releases in our [CHANGELOG file](https://github.com/GetStream/stream-chat-android/blob/main/CHANGELOG.md). These will always highlight breaking changes.

We also maintain a separate document, [DEPRECATIONS](https://github.com/GetStream/stream-chat-android/blob/main/DEPRECATIONS.md), which lists deprecated constructs in the SDK, with their expected time of further deprecations and eventual removal.

:::info
You can get notified of new releases by using the _Watch_ button in the [getstream/stream-chat-android](https://github.com/GetStream/stream-chat-android) repository. You can tweak your watch preferences to subscribe only to release events.
:::

### How Should I Specify My Dependency Version?

You should use a fixed version in order to avoid any conflicts or unpredicted behaviour.

For example:

```groovy
implementation "io.getstream:stream-chat-android-compose:6.0.0"
```

### Snapshot Builds

We publish SNAPSHOT versions of our SDK, which contain the code as of the latest commit on [the `develop` branch](https://github.com/GetStream/stream-chat-android/tree/develop).

These builds may contain bugs or breaking changes that will be fixed before the next proper release. However, you can use these builds temporarily to include the latest changes from our SDK in your project before the next release happens.

:::warning
Snapshot builds are not stable. Never use them in production.
:::

To use snapshot builds, you need to add the Sonatype snapshot repository in your Gradle build configuration (see at the top of this page for where to add this):

```groovy
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
```

Then you can add a snapshot dependency on any of our artifacts, replacing the normal version number with a version that has a `-SNAPSHOT` postfix.
Our snapshot version is always one patch version ahead of the latest release we've published. If the last stable release was `X.Y.Z`, the snapshot version would be `X.Y.(Z+1)-SNAPSHOT`.

You can browse our available snapshot builds in the [Sonatype snapshot repository](https://oss.sonatype.org/content/repositories/snapshots/io/getstream/), which you can also check for what the latest available snapshot version is.
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Installation

All Stream Android libraries are available from MavenCentral, with some of their transitive dependencies hosted on Jitpack.

Before you add Stream dependencies, update your repositories in the `settings.gradle` file to include these two repositories:

```groovy {5-6}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
```

Or if you're using an older project setup, add these repositories in your project level `build.gradle` file:

```groovy {4-5}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
```

Check the [Releases page](https://github.com/GetStream/stream-chat-android/releases) for the latest version and the changelog.

[![Latest version badge](https://img.shields.io/github/v/release/GetStream/stream-chat-android)](https://github.com/GetStream/stream-chat-android/releases)

## Available Artifacts

### Client

To add the low-level Chat client library to your app, open your module's `build.gradle` script and add the following:

```groovy
dependencies {
implementation "io.getstream:stream-chat-android-client:$stream_version"
}
```

### State

To use the state library in your application, add the following dependency:

```groovy
dependencies {
implementation "io.getstream:stream-chat-android-state:$stream_version"
}
```

### Offline Support

To use offline support in your application, add the following dependency:

```groovy
dependencies {
implementation "io.getstream:stream-chat-android-offline:$stream_version"
}
```

This also adds the client library automatically.

### UI Components

To use the [UI Components](../02-ui-components/01-getting-started.mdx) in your application, add the following dependency:

```groovy
dependencies {
implementation "io.getstream:stream-chat-android-ui-components:$stream_version"
}
```

Adding the UI Components library as a dependency will automatically include the client and offline libraries as well.

### Compose UI Components

To use the [Compose UI Components](../03-compose/01-overview.mdx) instead, add the following dependency:

```groovy
dependencies {
implementation "io.getstream:stream-chat-android-compose:$stream_version"
}
```

Adding the Compose UI Components library as a dependency will automatically include the client and offline libraries as well.

### Markdown support

We ship an additional artifact for Markdown support which can be used together with the UI Components library:

```groovy
dependencies {
implementation "stream-chat-android-markdown-transformer:$stream_version"
}
```

For more information see [UI Components Configuration](../02-ui-components/03-customizing-components.mdx#markdown) guide.

### Push Notifications

We ship multiple artifacts to easily integrate Stream Chat with third party push notification providers. See the [Push Notification page](../08-client/06-guides/01-push-notifications/01-overview.mdx) for more details.
Loading

0 comments on commit e322037

Please sign in to comment.