Kotlin Messenger 06: Send and Listen for Chat Messages


It’s finally time for us to send messages in our ChatLogActivity screen. This will first require us to save a list of messages under a node in Firebase Database. Next, we’ll listen for all these messages as they are entered in the system, and then refreshing our list in real time. In the next lesson, we’ll have to figure out how to send messages to multiple users.

Podcasts Course

Intermediate Training Core Data

Instagram Firebase Course

Facebook Group

Completed Source Code





  1. Hey you are the best for tutorial thanks for your great work.
    Btw i don't understand how you can pass parameters to a class when it has not properties to receive it?
    Where are store the data then ? and how can i retreive it ?
    For exemple in the bind fonction i can't use the text passer as parameter to the item class if i don't add a propertie text.
    But you are able to do it.. maybe they fixed something cos your tuto is one and half year old or i am missing something ?

    Continue with your tutorial you are doing a very nice job and it's so helpfull !!

  2. hey nice series for beginners, i want to send image also in chat area how to do this please suggest me i am new to android development Thank You in advance

  3. How did you make your "messages" no without it being a key-value pair? When I attempt to create it, it prompts to pair it with a value. I'm not sure how to proceed with this part. Thank you in advance!

  4. hi)i have a question.I think than it will be right to make a chat between user1 and user 2,and when we have new message add that message to database/chat.So we gonna have in our database list of chats and in chat we gonna have list of messages,and our database will look more pretty .How can we do that?

  5. Brian don't know if you are aware but on intellij/android studio, you can do CTRL+I to popup a window to do all the necessary methods on the ChildEventListener, or on the light bulb do implement members.

  6. All efforts to try and follow this project from start has been effective until now, my chatmessage.text at 17:55 doesn't print out to log, it shows "exclusive-spans-cannot-have-a-zero-length" , also my adapter.add line in 23:31 doesn't work atall. I was thinking on improving this project for my final year but it has just been a waste of lots of weeks watching and implementing. (((

  7. For anyone getting a red textview_from_row at 2:48, you need to go into the "chat_from_row" layout and name the text box that we created in the last video. Also because we copied and pasted the "from layout" and created a "to layout", this might affect updating each text box name. An easy work around I found was to delete the second text box and create a new one.

  8. Just finished ep 6 of this wonderful series. I will rewatch it again before proceeding to ep 7 as I need to verify some details I may have glossed over.

    I hope you continue to have more Android/Kotlin content after this (intermediate/ core development or otherwise).

    I hope these lessons will help me prepare to land a job that is similar or close for mobile development, cheers and more power

  9. Hello, Brian! I try to combine this course with your Firebase Messenger Tutorial for iOS. In that project users in Firebase don't have uid property, instead they create "chatPartnerId" property from user's node in Database/users/StringIWantToGetAccessInKotlinApp. My question is: how can I get access to this "StringIWantToGetAccessInKotlinApp" in Kotlin App so that I can use previously created users. Sorry if it is hard-to-understand question)))

  10. hey man! it was a very useful episode. but there is one thing i think u forgot to think about. at this moment each user can see all other users available on the database, but its not true. each user must be able to search for users he/she wants. i hope u get the point. thanks alot !

  11. Glad to see you doing better!!! keep up the amazing vids and your school!!! you are the best!!! Can you explain how SDKs work, how they are written and used in projects. Same with libraries and how to find out what methods are available to you once you add an SDK or library to your project????

  12. Hey I love you videos keep up the great work. I have a humble request. Please make a video on how to attach images downloaded from firebase on multiple UIVIEWS that are attached back and forth and can be swiped right or left to view the next image just the way it is done in Tinder dating app. Please please please make this video…. And thanks again for all your awesome videos.

  13. Just discovered your channel the other day. I started off with self learning web development, but always found myself constantly battling in my head if I was learning the right languages and frame works. So many choices that it's easy to get paralysis from over analysis. So one day I started dipping my toes into mobile development, specifically IOS and I freaking love it. Now in spite of being 39 years old, and with no degree, I'm going to prove people wrong and become a professional ios developer.


Please enter your comment!
Please enter your name here