All Projects → GetStream → Stream Chat Android

GetStream / Stream Chat Android

Licence: other
Stream Chat official Android SDK. The tutorial covers how to build your own chat experience using either Java or Kotlin.

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Stream Chat Android

Emberclear
Encrypted Chat. No History. No Logs.
Stars: ✭ 157 (-4.85%)
Mutual labels:  hacktoberfest, chat, messaging
Qmchatviewcontroller Ios
An elegant ready to go chat view controller for iOS applications
Stars: ✭ 75 (-54.55%)
Mutual labels:  chat, messaging, messages
Chatkit
Android library. Flexible components for chat UI implementation with flexible possibilities for styling, customizing and data management. Made by Stfalcon
Stars: ✭ 3,496 (+2018.79%)
Mutual labels:  chat, messaging, messages
Applozic Ios Sdk
iOS Real Time Chat & Messaging SDK
Stars: ✭ 104 (-36.97%)
Mutual labels:  chat, messaging
Quickblox Javascript Sdk
JavaScript SDK of QuickBlox cloud backend platform
Stars: ✭ 98 (-40.61%)
Mutual labels:  chat, messaging
Mongooseim
MongooseIM is a mobile messaging platform with focus on performance and scalability
Stars: ✭ 1,387 (+740.61%)
Mutual labels:  chat, messaging
Applozic Web Plugin
Javascript (jQuery) Real Time Chat & Messaging plugin
Stars: ✭ 76 (-53.94%)
Mutual labels:  chat, messaging
Backgroundtask
An infinite backgroundTask based on playing blank audio file ...
Stars: ✭ 122 (-26.06%)
Mutual labels:  chat, messages
Talk Example
This project is demo for Laravel-Talk package and its also Docker ready
Stars: ✭ 117 (-29.09%)
Mutual labels:  chat, messaging
Im service
golang im server
Stars: ✭ 1,694 (+926.67%)
Mutual labels:  chat, messaging
Sum
SUM - Secure Ultimate Messenger
Stars: ✭ 154 (-6.67%)
Mutual labels:  chat, messaging
Webapp
Tinode web chat using React
Stars: ✭ 156 (-5.45%)
Mutual labels:  chat, messaging
Lax
IRC client built with Electron & React
Stars: ✭ 95 (-42.42%)
Mutual labels:  hacktoberfest, chat
Le Chat Php
A PHP Chat based on LE CHAT
Stars: ✭ 95 (-42.42%)
Mutual labels:  hacktoberfest, chat
Bluetoothchat
Messaging over Bluetooth (Android)
Stars: ✭ 105 (-36.36%)
Mutual labels:  chat, messaging
Matrix Commander
simple but convenient CLI-based Matrix client app for sending and receiving
Stars: ✭ 90 (-45.45%)
Mutual labels:  chat, messaging
Android yichat lite
android client
Stars: ✭ 118 (-28.48%)
Mutual labels:  chat, messaging
Mnm
The legitimate email replacement — n-identity, decentralized, store-and-forward, open protocol, open source. (Server)
Stars: ✭ 162 (-1.82%)
Mutual labels:  chat, messaging
Android Kotlin Chat App
Open-source Voice & Video Calling and Text Chat App for Kotlin (Android)
Stars: ✭ 76 (-53.94%)
Mutual labels:  chat, messaging
Hiya Hiya Hiya
Whatsapp Clone base on Firebase Cloud Messaging
Stars: ✭ 139 (-15.76%)
Mutual labels:  hacktoberfest, chat

Official Android SDK for Stream Chat

Build status GitHub release

This is the official Android SDK for Stream Chat, a service for building chat and messaging applications. This library includes both a low-level chat SDK and a set of reusable UI components. Most users start with the UI components, and fall back to the lower level API when they want to customize things.

Quick Links for getting started

Java/Kotlin Chat Tutorial

The best place to start is the Android Chat Tutorial. It teaches you how to use this SDK and also shows you how to make frequently required changes. You can use either Java or Kotlin depending on your preference.

Free for Makers

Stream is free for most side and hobby projects. To qualify your project/company needs to have < 5 team members and < $10k in monthly revenue. For complete pricing details visit our Chat Pricing Page

Sample App

This repo includes a fully functional example app featuring threads, reactions, typing indicators, optimistic UI updates and offline storage. To run the sample app, start by cloning this repo:

git clone [email protected]:GetStream/stream-chat-android.git

Next, open Android Studio and open the newly created project folder. You'll want to run the stream-chat-android-ui-components-sample app.

The stream-chat-android-sample module contains the sample app for our previous UI implementation.

Docs

The official documentation for the Chat SDK is available on our website. Each feature's page shows how to use it with the Android SDK, plus there are further Android-exclusive docs under the Android sections on the top.

The Chat Android SDKs support both Kotlin and Java usage, but we strongly recommend using Kotlin. The documentation is available in both languages.

You can also take a look at the full API documentation (generated by Dokka).

This SDK consists of the following modules / artifacts:

With these modules, the SDK provides:

Supported features

  • Channels list UI
  • Channel UI
  • Message reactions
  • Link preview
  • Image, video and file attachments
  • Editing and deleting messages
  • Typing indicators
  • Read indicators
  • Push notifications
  • Image gallery
  • GIF support
  • Light and dark themes
  • Style customization
  • UI customization
  • Threads
  • Slash commands
  • Markdown message formatting
  • Count for unread messages

Installing the Kotlin/Java Chat SDK

Step 1: Add mavenCentral to your repositories in your project level build.gradle file:

allprojects {
    repositories {
        mavenCentral()
    }
}

Step 2: Add the library as a dependency in your module level build.gradle file:

See the releases page for the latest version number.

android {
    ...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    // for Kotlin projects
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
    implementation "io.getstream:stream-chat-android:$stream_version"

    // for Java projects
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

Setup Stream Chat

Make sure to initialize the SDK only once; the best place to do this is in your Application class.

class App : Application() {
    override fun onCreate() {
        super.onCreate()

        val apiKey: String = ...
        val user = User().apply {
            id = ...
            image = ...
            name = ...
        }

        val client = ChatClient.Builder(apiKey, this).build()
        val domain = ChatDomain.Builder(client, user, this).offlineEnabled().build()
        val ui = ChatUI.Builder(this).build()
    }
}

With this, you will be able to retrieve instances of the different components from any part of your application using instance(). Here's an example:

class MainActivity: AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val chatClient = ChatClient.instance()
        val chatDomain = ChatDomain.instance()
        val chatUI = ChatUI.instance()
    }
}

Online status

Connection status to Chat is available via ChatDomain.instance().online which returns a LiveData object you can attach observers to.

ChatDomain.instance().online.observe(...)

Markdown support

Markdown support is based on Markwon 4. The SDK doesn't support all Markwon features, support is limited to these plugins:

If you want to use a library other than Markwon or extend the Markwon plugins, you can use the code below to customize Markdown rendering when you build your ChatUI instance:

val ui = ChatUI.Builder(context)
    .withMarkdown { textView, text ->
        // do custom rendering here
        textView.text = text
    }
    .build()

Debug and development

Logging

By default, logging is disabled. You can enable logs and set a log level when initializing ChatClient:

val client = ChatClient.Builder(apiKey, context)
    .logLevel(ChatLogLevel.ALL)
    .build()

If you need to intercept logs, you can also pass in your own ChatLoggerHandler:

val client = ChatClient.Builder(apiKey, context)
    .logLevel(ChatLogLevel.ALL)
    .loggerHandler(object : ChatLoggerHandler {
        override fun logD(tag: Any, message: String) {
            // custom logging
        }

        ...
    })
    .build()

To intercept socket errors:

client.subscribeFor<ErrorEvent> { errorEvent: ErrorEvent ->
    println(errorEvent)
}

All SDK log tags have the Chat: prefix, so you can filter for that those in the logs:

adb logcat com.your.package | grep "Chat:"

Here's a set of useful tags for debugging network communication:

  • Chat:Http
  • Chat:Events
  • Chat:SocketService
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].