How to connect your app to the Firebase. Android studio Kotlin.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys and welcome back this is mosten from the mkr developer Channel this is the first video of the new city and in this city I'm going to show you how to use the Firebase real-time database in this video uh we will connect the project which is here to the Firebase project and I will show you how to send uh like our code simple data only one word from the app to the Firebase and in the next video we will create the app we will expand it and we will get the data from the user and we will forward it to the Firebase database and later in the next videos we will retrieve the data we will fetch the data from the Firebase and we display it in the recycler View and this is will be the whole application so let's get started with connecting the application to the Firebase for this there is two ways the first way is to go to the console.firebase.google.com and log in with your email here click on this button create a project and here copy the package and write it into the project and write the dependencies and everything by hand and connect this application to the Firebase but I'm going to show you an easier way for this go to the Android Studio go to the tools and here you have the Firebase button click on it the assistant will be open on the right side and you can see all of the services of the fireplace in this city we are using the real time database as I told you click on it you have two options here get started with real-time database which is for Java and here get started with real-time database cutlate so click on it then you have to click connect to the Firebase and let me show you what will happen connect to fire and as you see now my uh tone suit is open now I'm going to click on this ad project and the name of this application which is fire Firebase real-time example will come here continue again continue and here I accept uh either you can click on the create project or select the default account and create the project [Music] okay continue connect and your app is connected to the player now can The Next Step let me go back into the console yeah like that but let me go to the cons soon and here is the project okay the next step is adding the dependencies and everything so uh if you go to the project cancel it go to the project and uh to the other you see that there is nothing here and also here there is no plugin and everything but if you accept it automatically the Firebase will be added here and as long as the Gradle build finish you can use your project [Music] okay connected and the dependencies set up correctly you have a guide here and tells you how to send hello word to the Firebase real-time database and also uh some more data so we don't need it I'm going to explain it for you here also let me show you we have this if you want to write them by hand let me Zoom and here at the Firebase or edit and on the top this one the plugin Google services is added to this let me add the view binding here as well if you don't know how to use your binding you can click on this link and watch video about it let's update this okay and we will sync it okay thing is done and everything is set so let's go to the console.fire base again and here to the build to the real-time database create database I'm going to leave it just like this and then next here you have two ways the rule is the false now automatically and you cannot read or write data into the real-time database you have to connect either the authentication Service also to check the users or start in test mode and you see until one month you will have permission to read and write data from these the database so I'm going to click on enable and our database is created here and this is the rule it's here if you forgot and you left it false you can come here just you will see instead of this defaults you can write true and click on publish and it will be okay so uh I think everything is ready to use uh let's go back down to this [Music] here in the main activity I'm going to create in its variable let me Zoom binding activity main bind here today layout translator binding The Roots okay as I told you we are going to send the hard code to the database only a single sentence so here I'm going to add this tanky League listener for this text View and whenever we are clicking on it we want to send the data let me do some changes here to make it more easy but I'm going to make it a bit larger and create ID for it easy and data that's everything for the layout and here binding Dot TV send data Dot that on electricians and okay let's write the code regarding to the files here we need some variable okay private relating its variable and I'm going to call it Firebase reference with a type of data base reference okay and here for your base reference equals to Firebase database dot get instance dot get reference and you can leave it just empty like that or either you can even you can use the instead of this the reference and that works perfectly but I recommend you to write a name here so I'm going to write that test for now and later in the next videos we'll change and here uh Firebase preference dot this value [Music] okay then after that you can write uh add on complete listener and here I'm going to write a toast message foreign let's check it randomly I'm going to install it before the test let me tell you something here uh in the project in the project View um here in the app we need spoiled Google Dash services.json when you are connecting this application through the tools that Firebase automatically this will be added here but check sometimes uh maybe there is some problem and you don't have this file here and it will not work your application so check it always and that is installed so let's go to the [Music] we want to send this sentence to the data I'm going to click on it and here we have subscribe and the name is test the name of the database as here we named the test and really it's a real-time database and you see there is no delay between clicking and watching the data into the database in next video I will show you how to create child's uh to have some branches and to have some unique IDs for each line of data and export data from like here as a Json file to see it on your application in the recycling be with me in the next videos and you will have some fun together okay if you are satisfied all this content please give me a thumbs up and you if you haven't subscribed the Channel Please Subscribe the channel and hit the Bell button down below to be aware about new videos if you have any question and any comment write down below please for me I will be so happy to read your comments and answer to them thank you very much for your time bye
Info
Channel: MkrDeveloper
Views: 11,306
Rating: undefined out of 5
Keywords: connect your app to the firebase realtime database kotlin android, realtime database, firebase android studio, firebase tutorial, new project in firebase database kotlin, how to connect your app to firebase, firebase kotlin android studio, firebase kotlin, firebase 2023 kotlin, android studio tutorial, kotlin, MkrDeveloper, mohsen mashkour, android, android studio, realtime database firebase, firebase, how to use firebase, firebase realtime database android studio kotlin
Id: KiJy5Oi4rRo
Channel Id: undefined
Length: 16min 53sec (1013 seconds)
Published: Sat Mar 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.