/android-chat-tutorial

Sample apps for the Stream Chat Android SDK's official tutorial

Primary LanguageJavaBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Android Chat Tutorial Sample

This repository allows you to check the result after completing each step described in the Android Chat Tutorial. It contains samples written in both Kotlin (samplekotlin module) and Java (samplejava module). For more Android Chat examples, see the Github repo for the SDK and the UI Components sample app in it.

Already all-in on Jetpack Compose? Check out the tutorial repo of our Compose UI Components instead.

The project is pre-configured with a shared Stream account for testing purposes. You can learn more about Stream Chat here, and then sign up for an account and obtain your own keys here.

Quick start

  1. Clone the repository
  2. Open the project in Android Studio
  3. Run the samplekotlin or samplejava configuration
  4. Make sure to check the Details section below for customizations

Details

The sample apps consist of two screens:

  • MainActivity: Shows the list of available channels.
  • ChannelActivity: Shows the selected channel view, which includes the header, message list, and message input view.

Each module contains multiple ChannelActivity implementations, which correspond to the steps of the tutorial. You can easily swap them by changing the setOnChannelClickListener located in MainActivity:

channelListView.setOnChannelClickListener { channel ->
    // open the channel activity
    startActivity(ChannelActivity.newIntent(this, channel))
}

Currently, you can choose from four different ChannelActivity implementations:

  • ChannelActivity - a basic Message List implementation
  • ChannelActivity2 - includes a new MessageListView style and custom attachment type
  • ChannelActivity4 - includes a custom Typing Header component created with the Low-Level Client library