Creating Chatting Application in Android Studio Using Kotlin | GeeksforGeeks
HTML-код
- Опубликовано: 21 авг 2024
- In this video, we're going to discuss how to create a Chat Application in Android Studio using Kotlin. The application will consist of a Sign Up / Login Page and will allow you to chat with other users without any hassle. So, let's get started now.
Check Out the Related Articles:
Complete Kotlin Tutorial [www.geeksforge...]
Complete Android Tutorial [www.geeksforge...]
Apply For Video Internship Program - script.geeksfo...
Our courses: practice.geeks...
This video is contributed by Abhay Maurya.
Please Like, Comment, and Share the Video with your friends.
#android #project #kotlin #androidstudio #appdevelopment
Install our Android App:
play.google.co...
If you wish, translate into the local language and help us reach millions of other geeks:
www.youtube.com...
Follow us on our Social Media Handles -
Twitter- / geeksforgeeks
LinkedIn- / geeksforgeeks
Facebook- / geeksforgeeks.org
Instagram- www.instagram....
Reddit- / geeksforgeeks
Telegram- t.me/s/geeksfo...
Also, Subscribe if you haven't already! :)
Hi sir, thanks for the video. Just to let others know that one year after you published it I was able to get it to work. For some bizarre reason, the chat layout design did not work as expected and all components were all over the place, but after a quick search I was able to get it to work as well. Thanks again.
Hello, How did u overcome this problem? Could we connect on LinkedIn Or GitHub regarding this?
@@karthikprabhu23223 For me the fix was to start the project as an "Empty Views Activity" instead of just an "Empty Activity". and whenever a new empty activity is made I use Empty Views Activity instead.
That seems to get stuff working, though please be aware that I am new and inexperienced, so not sure what the difference is and if I may be messing something up later on.
@@skootz24 Thank you for replying. 😃
bro can you share the source code with us plz... it will be of great help
25:00 for newer versions it will appear the "apply" as an "id" just paste them in the plugin section at the top and if it repeats with an already previous id just delet the new one.
Thank you for such a great tutorial, i've been searching for a long time for this kind of content and i found yours. Rich and straight forward content.
Thanks buddy, I watched the whole video and applied. Which works fine, do continue great tutorials.
can you please share your code
Thanks!
Thanks a lot for this detailed explanation. That is just the best tutorial in creating the chat in Android- step by step, everything is clear. I had some difficulties with the RecyclerView, because my Android Studio didn't except some part of the code in xml file, so I had just deleted a little bit and it started to work. Thanks a lot for this great video !!!!!!!!!!!!!!!!!!!!!!!!!
Could you please reply with the changes you made...
Thank you! Will try this ASAP
Firebaseauth at 29:50 is not working for me, help me.
@@Trigoter shut android studio and open again... May be it will work.
Contacts are not showing
Can you helpme
I love your content it is very straight forward the best for programmers personality they want to see things working after long hours of coding!
i have an erron in build.gradle error is all buildscript {} blocks must appear before any plugins {} blocks in the script please help.
Thanks so much, the app work exact as yours.. looking forward to more video on improving it's functionality and most especially attaching files
Can you please share your code
Thats so nice video. I did this application with you.
Completed. Thank you so much sir😌🙏🏻🙏🏻💙
did you get same gradle as same as in video
@@BadBoy-sc3xv no. It was totally different. I guess it's updated that's why. So I added this in Gradle (project) file :
buildscript{
repositories {
jcenter()
}
dependencies{
classpath 'com.google.gms:google-services:4.3.13'
}
}
can you please share your code
I have successfully completed this project
Hi, did u used Android Studio Iguana?
bro you got the name of all users present in Realtime database in your Recycler View?
i don't get the user in my recyclerView .
can you explain me please?
@@maisakurajima9194 kotlin
Hi can i massage you to send a source code
@@user-um6wt8td9z yes
Absolutely is amazing your explaining and everything is simple Many thanks for Abhay Maurya.
Completed Thanks ❤❤
Can u provide source code?
24:43 i haven't found a build gradle and dependencies can u help me ?
When you reopen application, it automatically log out, so we have to sign in everytime.
That is annoying, can someone suggest how to fix it, or what snippet do i have to use to stay signed in
It would be better to share the source code link.
If he does that,then what u will do 😂😂
Hi can u share it?
The firebase gradle thing was hard for me, but I fixed it with this:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.14'
}
}
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}
Thank you very much!
@@alishershalken1664 np!
Thanks alot
tnx
thank you so mch man helped a lot
Thank you so much sir 🙏
Thank you so much ✨️
Just finished the app!!!! Great stuff!!!!!
does it work properly?
Does the project run successfully? Could you share the GitHub repo?
can you please share your code
Thank u very very much sir
Contacts are mot showing 1:24:50
24:26 , in the new android studio, there is a difference in the build.gradle , there are no such dependencies , Then where to paste that classpath ? Pls reply me ASAP .
In this app, do you load the users existing contacts from the android system ? And also do you listen for contacts changes in android system ?
So instructive, keep it up!
Can we download the created app 9n android studio to our phone 📱
i want your gradle(app) file. will u share the picture of the dependencies?
Thanks for this effort
THANK YOU SO MUCH FOR SHARE THIS CONTENT, ITS JUST AMAZING! ❤️
Simply awesome
Thancx a lot sir, lot of things learned
you are great, it works properly
I am following the same code as you are doing but my values are not getting stored in realtime firebase. My Authentication is working fine but values are not getting stored. Can you please help on this. I am stuck because of this.
Yes, you are resolve this problem, i'm also stuck this step.please can you help me ?
the best tutorial ever
Really wanted this tutorial 🔥
Sir, Im having trouble on creating the Signup part...it keeps telling me Some error occured(From our command) but when I check I did everything you did...What the problem?
I had a similar issue, the password must be with letters and numbers ? or there is a minimum required length, so try a more complex password maybe
@@justtocomment2416 Sir, I did that also and still didn't work.
Same problem , pls help .
I guess, you are testing the app on other device, you should enter the firebase and turn on auth. from that device, that you test the app.
in signin page else part is running if is not running
I will be going to make this app. Thanks yar.
Great Understanding Video you made thank you
I have finished the video and coding.. Fixed all the errors until the end. But first app was crushing so I simply added push() to the code. Now no crash but the messages wont pop up. If someone knows the solution please.
Contacts are not showing can you help me
Can't retrieve contact from data base
1:34:48 don't mind me, just putting a bookmark for myself
When I signed in my app it crashes pls help
Great sir👍
Thank You, nice tutorial
cool video)
sir i got only one type of messages mean reciverroom or senderroom how to handle such problem pls
I have an error Caused by: kotlin.UninitializedPropertyAccessException: lateinit property btnSignUp has not been initialized
You probably didn't declare "btnSignUp" in your activity page...
private lateinit var signup_btn: Button
type the above ststement in your signup_page.kt
then declare it using FindViewById function...
hope this might be helpful🙂
Amazing
I followed the exact same process, but could not see the data in Realtime Database
. 1:10:53
I have the same problem, did u find a solution?
Check your child nodes Names
I have the same issue
Thank you sir ji ,
Login Problem : using trim, realtime problem : Only using USA region not Singapore
First of all thank you for this amazing chatapplication got to learn new concepts. I followed the steps as shown but I don't know why as soon as I login the window takes some time and the app crashes. Although I have installed all the dependencies.
Can you please help me out
Hey, try checking in the 'Login.kt' under OnClickListener in val intent you might have typed 'btnsignup' instead of 'Signup'. I made the same blunder.
@ 1:01:45 How do you reference the adapter? It just doesn't work. It appears red and it says unresolved reference. Do I need any dependencies for this? Please help.
I had the same problem but then I rechecked
And found that I made this file in wrong path ..please recheck tha path
1:10:42 When I try to sign up ,it crashes. In authentication, I can see my users but in database, I cannot. Is there anything I can do to make it right.
Hi i got the same problem did you get the solution?
haii i'm facing this error
java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.Button ,
please help me
Thank you very much, my sir
Please do one project Retrofit and room database using MVVM
Amazing Tutorial!!
Thank you very much!
Sir can I know what is the bandwidth?
Thanks to you sir for this stuff
Thank you so much
Amazing!
Thanks for sharing
İsnt it better with using viewBinding and fragment components
Yes better
Great Tutorial!!! But I got a sticky question: "How do I implement a security rule so no user with access to the firebase realtime through console could change any value on the database?" For example, how to avoid that someone could change a message text through firebase console?
By storing encrypted messages.
Thank u very much
log out button and that menu is not showing in my app
Thank you.
Any one please help me ,
I am created app by watching whole video it work perfectly but it give one issue,
Issue is that when two people chat then sender can send only one message, not more than one.
If sender want to send message again that people then there edittext message will clear and message add on data base but but not reflect on UI .
watch the video from 2:12:00 cause i guess you forgot to add message.notifyDataSetChanged
hope this might work
good luck...
@@syedmohammadhamzahusain998 Hi, i am having this issue. I can send messages from person A to person B however when i try to reply as person B the app crashes. How can i fix this issue
@@syedmohammadhamzahusain998 do u have the source code?
Thank You for this Sir!
hey, can your share source code of this application
24:35 I have some issues with gradle top level build file, when I opened mine file, it looks different than yours. I don't have buildscript, dependancies and all project, what should I do?
I did it xd
Copy buildscript and dependencies from firebase and don't copy all projects
Paste buildscript and dependencies above plugins
@@matwit91 Can you let me know , m facing the same issue
pls help me how did you solve that
@@rolandbogdan8502 Copy buildscript and dependencies from firebase and don't copy all projects
Paste buildscript and dependencies above plugins
from Srivalli answer
You are the best
Does it work for people with different internets?
why use relative layout when you have constraint Layout?
I am trying to this tutorial on 5/3/2022 and i have troubles with
build.gradle(chatApplication)....any help?
I am having the same issues
i don't know what your exact problem but it works when i add those;
To Gradle Project level add this lines
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.3.10'
}
}
To Gradle App level;
plugins {
...
id 'com.google.gms.google-services'
}
dependencies {
implementation 'com.google.firebase:firebase-auth-ktx:21.0.3'
implementation 'com.google.firebase:firebase-database-ktx:20.0.5'
implementation("androidx.recyclerview:recyclerview:1.2.1") // recycler
implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
implementation platform('com.google.firebase:firebase-bom:30.0.1') implementation 'com.google.firebase:firebase-analytics-ktx'
}
hope you fix it.
Do you go over draw over other apps on this? I'm looking to be able to have user click a button that overlays on other apps to send a message that way.
you need to use fragments
can you provide for us the manifest file because i dont know how relate each interfaces between them
When I'm adding to the Realtime Database from Android Studio, there it shows the JAVA version instead of KOTLIN. What should I do? Do I continue to add JAVA only?
Sorry sir. I have followed your tutorial, but the textview cannot display the sender and the recipient, what is the solution?
I have the same problem
Did u got the solution??
@@anshumanmohapatra1173 not yet sis
@@lanajauhar5461 i am a male bro
@@anshumanmohapatra1173 sorry, typo
If there was rating for this video it would be 5/5
log out option is not coming
Please help me out I am facing too much issues creating this app, I have to add it in my resume
can you make a group chat, that is chatters can join specific groups for shared chat?
any chance of creating both one to one chats and also mainly have group chats, where 3,4,5 or evne 10 members can chat all together at the same time? please anyone let me know if you ever see this kind of chat app functionality and where to find it. thanks everyone, and great video by the way lol.
i am having a issue in sign up and login . on signup page its showing authentication failed but on the firebase user is registering . and also login is not happing . authenticating failed is the error. can you give me a hint
Help!!
When connected to Firebase, the button setOnClickListener failed to jump to the sign up page. What should I do?
Great!!!
can comeone tell me why only one layout is inflated all messages are in receive layout? even when Im the sender
It's working for me 💥
bro please share the source code with me
Bro when we are using @signup and @login it is showing ambiguous error and app is not starting in phone from start it is crashing can you give the solution pls .
Can you make this same app in Java ?
Thanks
hello Can you put theis app google play ? is that any securty ıssues about these app ? I am not going t copy these but I am trying to make these kind of application .I just want to learn that If i do this kind of app google play accept this ?
thanks !
can you please provide git hub repo , or any drive link of this project?
Awesome work.....
Please upload React js project also
app crashing after i press on any name in chatACtivity what might be the error
here is the code from messageAdapter class
class MessageAdapter(val context: Context, private val messageList:ArrayList) :
RecyclerView.Adapter() {
val ITEM_RECEIVE = 1
val ITEM_SEND = 2
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
if(viewType == 1){
val view: View = LayoutInflater.from(context).inflate(R.layout.receive,parent,false)
return ReceiveViewHolder(view)
}else{
val view: View = LayoutInflater.from(context).inflate(R.layout.sent,parent,false)
return SentViewHolder(view)
}
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val currentMessage = messageList[position]
if(holder.javaClass == SentViewHolder::class.java){
val viewHolder = holder as SentViewHolder
holder.sentMessage.text = currentMessage.message
}else{
val viewHolder = holder as ReceiveViewHolder
holder.receiveMessage.text = currentMessage.message
}
}
override fun getItemViewType(position: Int): Int {
val currentMessage = messageList[position]
return if(FirebaseAuth.getInstance().currentUser?.uid.equals(currentMessage.senderId)){
ITEM_SEND
}else{
ITEM_RECEIVE
}
}
override fun getItemCount(): Int {
return messageList.size
}
class SentViewHolder(itemView: View) :RecyclerView.ViewHolder(itemView){
val sentMessage = itemView.findViewById(R.id.txt_sent_message)!!
}
class ReceiveViewHolder(itemView: View) :RecyclerView.ViewHolder(itemView){
val receiveMessage = itemView.findViewById(R.id.txt_receive_message)!!
}
Awesome, Please make screen recording app
Firebaseauth at 29:50 is not working for me, help me.