An open API service indexing awesome lists of open source software.

https://github.com/sendbird/sendbird-chat-sample-android


https://github.com/sendbird/sendbird-chat-sample-android

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

# Sendbird Chat sample for Android

## Overview

This repository provides feature-level Chat samples with Kotlin to demonstrate how to use the [SendbirdΒ Chat SDK](https://sendbird.com/docs/chat).

## πŸ”’ Security tip
When a new Sendbird application is created in the dashboard the default security settings are set permissive to simplify running samples and implementing your first code.

Before launching make sure to review the security tab under βš™οΈ Settings -> Security, and set Access token permission to Read Only or Disabled so that unauthenticated users can not login as someone else. And review the Access Control lists. Most apps will want to disable "Allow retrieving user list" as that could expose usage numbers and other information.

## Requirements

Android Studio 2.0+

## Running the app

Open this project in Android Studio and select 'run configurations' to view a dropdown of feature-level Chat samples to choose from.

Once a sample is chosen, create a device and run the app on an Android device or Android emulator.

### Language

+ Kotlin

### Version

+ Android SDK
+ compileSdk: 32
+ minSdk: 26
+ targetSdk: 32
+ Gradle Version
+ gradle: 7.2
+ android gradle plugin: 4.2.0

## Project structure

```
.
β”œβ”€β”€ commonmodule
β”‚ β”œβ”€β”€ ui
β”‚ β”‚ β”œβ”€β”€ CustomViews
β”‚ β”‚ └── base
β”‚ β”‚ β”œβ”€β”€ BaseApplication
β”‚ β”‚ β”œβ”€β”€ BaseActivity
β”‚ β”‚ └── BaseFragment
β”‚ └── utils
β”‚ β”œβ”€β”€ Utils
β”‚ └── Extension
β”œβ”€β”€ groupchannel-basic
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-typingindicator
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-readnessage
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-unreadmessages
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-onlinemembers
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-membersandoperators
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-banned-and-muted-users
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-groupchannel-add-remove-operators
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-mention-members
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-report-user-message-channel
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-freeze-unfreeze
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-mute-user
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-admin-message
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-ban-unban-user
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-mark-message-read
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-push-notifications
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ groupchannel-update-message-operator
β”‚ β”œβ”€β”€ groupchannel
β”‚ β”œβ”€β”€ main
β”‚ └── user
β”œβ”€β”€ openchannel-basic
β”‚ β”œβ”€β”€ openchannel
β”‚ └── main
β”œβ”€β”€ openchannel-user-online
β”‚ β”œβ”€β”€ openchannel
β”‚ └── main
β”œβ”€β”€ openchannel-update-message
β”‚ β”œβ”€β”€ openchannel
β”‚ └── main
β”œβ”€β”€ openchannel-delete-message
β”‚ β”œβ”€β”€ openchannel
β”‚ └── main
β”œβ”€β”€ openchannel-copy-message
β”‚ β”œβ”€β”€ openchannel
β”‚ └── main
β”œβ”€β”€ openchannel-mention-user
β”‚ β”œβ”€β”€ openchannel
β”‚ └── main
β”œβ”€β”€ openchannel-report-message-user-channel
β”‚ β”œβ”€β”€ openchannel
β”‚ └── main
β”œβ”€β”€ openchannel-admin-message
β”‚ β”œβ”€β”€ openchannel
β”‚ └── main
└── openchannel-feature-a
...

```

### [CommonModule](https://github.com/sendbird/sendbird-chat-sample-android/tree/main/commonmodule)

- [ui](https://github.com/sendbird/sendbird-chat-sample-android/tree/main/commonmodule/src/main/java/com/sendbird/chat/module/ui)
- Created for frequently used views.
- Created activities commonly used such as Sign-Up, Splash, and UserInfo.
- [utils](https://github.com/sendbird/examples-chat-ios/tree/main/CommonModule/CommonModule/View)
- Commonly used functions in Basic, Feature App

### BasicSample

- groupchannel-basic
- openchannel-basic

### FeatureSample

- groupchannel-typingindicator
- groupchannel-unreadmessages
- groupchannel-readmessage
- groupchannel-onlinemembers
- groupchannel-membersandoperators
- groupchannel-banned-and-muted-users
- groupchannel-user-online
- groupchannel-mention-members
- openchannel-user-online
- openchannel-delete-message
- openchannel-update-message
- openchannel-copy-message
...

## Considerations in real world app
- In this sample repo users are connecting to sendbird using a user ID (Sendbird Dashboard --> Security --> Read & Write). Read & Write is not secure and will create a new user automatically from the SDK if none exists. In production be sure to change the Sendbird Dashboard security settings to Deny login, and [authenticate users](https://sendbird.com/docs/chat/v4/android/guides/authentication#2-connect-to-sendbird-server-with-a-user-id-and-a-token) with a Sendbird generated Session Token.