Hello, and welcome. In this lesson, you will learn about web service connections for data display and retrieval. So here's our app. Let's give our app the ability to connect with a web service so that our user can interact with a real time database that is located on the web, which will allow us to display and retrieve data using a database. Right now in our app, we have this text field and it has the ability to bind our data to our Android device. But what if we need this data in a database so that we can share the data and use this name field, in a holistic system that will work in congruence with other pieces of data. For that, we need a web service that can provide a connection for data display and retrieval. So for the web service, I'm going to use Google's Firebase, which uses a next generation web service, web socket that provides a backend as service, a BaaS. And this service will tie us to a relational database management system, provided by Google called Firebase, which really works well with Android, for displaying and retrieving data. Now, since this is a cloud based system, we have to have a Google account and connect to the service. So I'm gonna search for Firebase, and I'm gonna pull up the first instance and here we have Firebase. So I'm gonna get started. And I'm gonna add a project. Now it's asking for a project name. So I'm gonna call this project, kotlin on fire. I'll say continue. And it's asking me if we want to enable analytics, I'm gonna say no, because this is just a test program. And I'll say, create my project. It's creating the project. Okay, our new project is ready, so I'll say continue. And we want to add Firebase to our app. It gives us the choice of iOS or Android or the web. So I'll choose Android. Now we need to register our app. So it's asking for the Android package name and that's contained in our app. So I'll go to Android studio. This is our app, and this is our package name right here, that's what it's looking for. It's called com.example.myapplication. All right, I'm gonna copy that line, go back over to Firebase, gonna insert that line here. I can give it a nickname if I want, and I can also give it a certificate, an SHA certificate, that's optional. I recommend that when you do the real program, you use the certificate, but we don't need it for now. So I'm gonna register the app. Okay, our app is registered. Now I need to download the config file, which is the Google web services json file. So I'm gonna download that. I'll click download. Here it is in my download file. So I wanna copy that file and I wanna add it to my kotlin program. So I'm gonna go up here in the upper left-hand corner, where it says Android. So under my projects tab, I'm gonna go to my application, double click there, and then under the app folder, I'm gonna open that up, and then in my source folder, I'm gonna highlight that and I'm gonna paste my json file into my source folder. There it is, google-services.json, so I'll say, okay. And there's my json file. So I'm gonna go back to Firebase, click next. Now in step three, we wanna add Firebase SDK. Okay, the first thing we wanna do is make sure that we have Google and our buildscript repositories. So let's go check that out. We'll go back to my program. It should be there. And we're gonna look at the project level buildgradle files. So I'm gonna go back to the upper left-hand corner, go back to my Android view, then I'm gonna go into my Gradle Scripts, and I'm gonna go into the buildgradle file for the project, not the module, but the project. I'll double click on that. Here's our buildscript file, the repository has Google, that's good. And then all projects' repository also has Google, so that's good. Okay, so now we need the dependencies and we need a classpath. We already have a classpath for the buildgradle and for the jetbrains kotlin, so we need another classpath for Google. So I'm gonna go back to Firebase and we want under dependencies, this classpath for Google services. So I'm gonna copy that code, I'm gonna go back to my program, and I'm going to paste it in here. Now we have Google services classpath, so that's good. Now back to Firebase, we finished the project level buildgradle. Now we have to update the app level buildgradle, which is an app module, and we have to apply the plugin. So I'm gonna get this plugin for Google, I'm gonna copy that line, I'm gonna go back to my kotlin program. Now this time, I want the buildgradle for the module, not the project, the module. So I'm gonna double click and these are our plugins. We have a plugin for the Android application and a plugin for kotlin Android. So I'm gonna add another one for Google. I'm gonna paste it in there, and we want to change this to id, and now we have the Google plugin, so that's ready to go. So now we have dependencies. So we need to fill on that. So I'm gonna go back to Firebase and our dependencies in Firebase is this file, implementation platform. So I'm gonna copy that, go back to my kotlin app, and then under dependencies, I'm gonna paste in that line of code right there. Okay, we're done with that portion. Now we've updated our code, so now I'm gonna sync all the changes that we made. So on the upper right-hand corner, I'm gonna click on sync now and that's syncing, it's rebuilding our gradle. Okay, the sync is finished, so I'm gonna go back to Firebase and click next. We've registered our app. We downloaded the config file. We added the Firebase SDK, and now we're all set. So there's Firebase documentation, if you need further instructions from Google, and now we can continue to our console. So I'll click on that, and here's our console for our project, kotlin on fire. And this is our service to our database, so that's ready to use. So our kotlin program is connected to our web database and we're ready for data display and retrieval. So that concludes our lesson on web service connections for data display and retrieval. Thanks for watching. Stay tuned for the next lesson. So let's go.