
Here is the code for our Chat screen also known as activity_chat.xml: We need to create a new Blank Activity first to have activity_chat.xml in our project with name ‘ ChatActivity‘ as an activity name. Chat Activity and Chat Bubble Layout (activity_chat.xml) The XML code for activity_main.xml is as follows: Implementation 'com.firebaseui:firebase-ui:0.6.2'Ĭreating Layouts Sign in Screen (activity_main.xml)įor Sign in Screen we need an Edittext field where user will put a random username and a Google SignInButton for user to sign in to the account. Implementation ':firebase-database:16.1.0' Implementation ':play-services-auth:16.0.1' Adding LibrariesĪdd the following libraries to your adle (app level) file and sync the project: implementation ':firebase-core:16.0.8' Learn more about enabling ‘Sign In With Google’ in your Android project from link here. Next, enable Sign in with Google and download and sync google-services.json file with Android Studio. Firebase Setup Chat application in Android Source CodeĬreate an empty project in Firebase and add your android app to Firebase project. Second, is the Chat activity which will contain an Edittext with a send button and where all chat happens.

In this project we have to create two activities, one Main Activity that’ll check if the user is signed in and if not then sign up or sign in back.

Open Android Studio and create a new Project (AndroidDvlpr Chat App) with an empty activity. Chat application in Android Source Code Getting Started We will use a simple ‘Sign In with Google’ and allow the user to create a username and start chatting. In this tutorial, you’ll learn to build your own Android Chat Application using Android Studio.
