How to add chat room on android video apps using Amity Chat

  • This is some text inside of a div block.
  • This is some text inside of a div block.
  • This is some text inside of a div block.
  • This is some text inside of a div block.

How to add chat room on android video apps using Amity Chat

Nowadays, many people are familiar with the famous streaming platform that was developed a lot of features to get over their competitors but most of them have one similar function, it is a chat room function on the live stream or a video you watch which each platform has a different trick to attract users whether it be stickers or emojis to express their opinion in one click. Today, we have a nice helper tool to create this chat room easily for you by using our ‘Amity Chat’.

Amity Chat is a highly flexible SDK for you to either create a new application to use separately or adapt it to your existing application. We have set up everything ready for you, for example, Group chat, 1–1 chat, a message report function, or the function that helps you create the difference emojis reaction pop up on other user messages while they watch the video or live stream.

Besides, those functions, we also prepared UI Kit to make the convenient front end to develop your application. Today, I want to show you a sample of a video streaming application development with Amity Chat to see how it likes and how it works, time waits for no man, let’s go and try out for this together!

(Technical part is about to begin…)


Required

  • Android Studio
  • Android 5.0 (API level 21 or higher)
  • Android X
  • Gradle 3.4.0 or higher
  • Java 8
  • Coffee or Tea and Snack

Download my code on GITHUB

import to android studio and you will get it like this

you will see module name videochatroom that is module for video chatroom

you can import this module to your own project but don’t forget to add maven in your build.gradle (project level)

{% c-block language="javascript" %}
repositories {
       
google()
       jcenter()
       maven { url 'https://jitpack.io' }
   }
{% c-block-end %}

and import my module to your project in build.gradle (Module level)

{% c-block language="javascript" %}
dependencies {
   
implementation project(path: ':videochatroom')
}
{% c-block-end %}

Easy to code, Faster time to market

  • call start activity and these value in putExtra .
  • apikey is a key to your organization’s environment. The app will show only data of your organization only.
  • channel ID is id to access amity chat channel.
  • User ID & User Name are identifier to your user and user name will display in chat message.
  • VideoName & VideoURL for you video view.

{% c-block language="javascript" %}
class MainActivity : AppCompatActivity() {    
   val API_KEY = "apiKey"    
   val VIDEO_URL = "videoUrl"    
   val VIDEO_NAME = "videoName"    
   val CHANNEL_ID = "channelID"    
   val USER_ID = "userId"    
   val USER_NAME = "userName"    

   override fun onCreate(savedInstanceState: Bundle?) {        
       super.onCreate(savedInstanceState)        
       setContentView(R.layout.activity_main)        

       val videoChatIntent = Intent(this, com.videoment.videochatroom.MainActivity::class.java)        
       videoChatIntent.putExtra(API_KEY, "apiKey")        
       videoChatIntent.putExtra(CHANNEL_ID, "channelID")        
       videoChatIntent.putExtra(USER_ID, "userId")        
       videoChatIntent.putExtra(USER_NAME, "userName")        
       videoChatIntent.putExtra(VIDEO_NAME, "videoName")        
       videoChatIntent.putExtra(VIDEO_URL, "videoUrl")        
       startActivity(videoChatIntent)        
       this.finish()    }}
{% c-block-end %}

That’s all you need to do ~~

now you can run the app and see the result on your phone. such a great thing right ?

Customization ? sure you can do it.

In my module you can customize whatever you want maybe replace my UI with your design or edit some font as you want.

I’m sure now you have a great idea on your mind :) just do it~~

Thank you for your time !!

I think you can run the app and see our magic but if you can’t reach it feel free to contact me anytime~~

If you are interested to learn more about Amity Chat, you can contact us at our website. and if you want more details about SDK, you can walk through our docs to know more.

The future is social, thank you, and see you again soon!