Kotlin
ChatClient
Before you can start a chat, the Client SDK needs to authenticate to the Vonage servers. Start by creating a new Kotlin file ChatViewModel.kt.
Create a new class ChatViewModel:
This class will create an instance of ChatClient then create a session using a JWT. Replace ALICE_JWT and BOB_JWT with the JWTs you created earlier.
Button Actions
For the log in buttons to work, you need to add actions to them which will run a function when they are tapped. Update the view code in MainActivity.kt to instantiate a ChatViewModel object and call its login function:
Creating an Android chat app
Create a Android application that enables users to message each other using the Android Client SDK and Kotlin.
Steps
1
Introduction to this task2
Prerequisites3
Create a Vonage Application4
Create a conversation5
Create the users6
Generate JWTs7
Create an Android project8
Building the log in interface9
ChatClient10
Building the chat interface11
Chat events12
Sending a message13
What's next?