‫-: Hi, within this lecture we are going to integrate Firebase
‫with our own project.
‫And in order to do that
‫of course we are going to create the project first of all.
‫So I'm going to open my androidstudio, okay?
‫And I'm going to create an empty project
‫and we are going to do everything from scratch together.
‫So make sure you open your androidstudio
‫and make sure you open a new androidstudio project.
‫So of course you could have used my codes in GitHub as well
‫but it's important that you understand the structure
‫of this app so that we will do it together
‫and you will have an understanding
‫of how apps like this are built from scratch, okay?
‫And even if you're not an android developer
‫if you're looking to be a mobile ethical hacker
‫I suggest you learn these things and I suggest you
‫just improve your android development skills.
‫So I'm going to come over here after choosing empty activity
‫and name my application SecureTweetApp.
‫It doesn't have to be necessarily
‫as the same as we have chosen in Firebase app, okay?
‫So I'm going to use this
‫and I'm going to use this package name.
‫So this is what we are going to give Firebase, okay?
‫So make sure this is not followed by com.example
‫but com. your name.
‫I'm going to choose minimum API level of 23.
‫As I said before, it doesn't really matter at this point.
‫You can go for the latest version, but I'm gonna go
‫for 23 because it's kind of a habit
‫for me and I'm going to choose Java as the language.
‫Then I'm going to say finish and my project will be created.
‫Great.
‫Next thing that we are going to do is to integrate Firebase
‫into our project.
‫And then after we do that we are going to copy
‫and paste everything from my GitHub account so
‫that we will have a working Firebase app
‫like a Twitter app, okay?
‫So here you go.
‫I believe it's ready for us right now.
‫Let me try to open, yep, it's already opened for me
‫and I can see my package name from here.
‫Okay, this is what we need in order
‫to give to the Firebase over here.
‫So I'm going to copy and paste this.
‫And for nickname, this is optional, but you can just
‫write the same thing like project name over here.
‫I'm gonna call this SecureTweetApp, and then later
‫on I'm gonna register my app.
‫So make sure you copy your own package name
‫rather than mine because I believe it has to be unique.
‫And if you chose mine, then it'll give you an error.
‫Next thing, it asks you to download a configuration file.
‫This is very important.
‫If you don't do the step, then your
‫androidstudio project will not be connected
‫to your Firebase project.
‫So this is the file that lets us connect our project
‫to the Firebase server and it has the configuration file
‫like it has the usernames
‫and keys and passwords and hashes and stuff.
‫In order to make it work
‫you have to click on this, download Google Services JSON
‫and it'll download the file for you.
‫And after it's completed, you're gonna have to
‫change the view of your project like this.
‫So this is android view by default
‫and then you're gonna have to switch it
‫to project view so that you can see all the files
‫and folders and make it into the right place like this.
‫So go to project view and open your app.
‫Not this one, open your app folder.
‫So this is where you should put it into
‫and of course you can see the right place
‫from the documentation as well.
‫So I'm gonna find my Google services JSON file
‫and I believe it's not over here even
‫though I have downloaded it.
‫So let me come back to my Safari
‫and let's see if we managed to download it.
‫Yep, it's timed out for some reason.
‫Let me try one more time and here you go.
‫Now I believe it's over there.
‫So let me open it.
‫And here you go.
‫googleservices.JSON.
‫It has to be exactly the same name.
‫Don't change this name, googleservices.JSON.
‫And it's in the app folder.
‫Just say okay, so if it's named something else
‫for example googleservices.JSON2, then it won't work.
‫Make sure it has the same name
‫it has the original name like this Google Services JSON.
‫So over here you can just say reveal in Finder
‫or reveal in Windows folders so that you can just drag
‫and drop your Google Services file over here as well.
‫This is an alternative
‫if dragging and dropping doesn't work for you
‫but most of the time dragging and dropping will work.
‫So you won't need it, but if you need it
‫you can open your SecureTweetApp
‫from your files and folders and bring it in.
‫So this is what we needed to do.
‫So I'm gonna switch back to android view, and this is done.
‫So I'm gonna say next it will ask me to add the SD case.
‫So these are software development kits
‫that I was talking about.
‫So this is what is great about Firebase.
‫It lets us communicate
‫with our Firebase server through our code.
‫We will write Firebase code inside
‫of our androidstudio thanks to this Firebase SD case.
‫And in order to download them to our project
‫we are going to use build.gradle.
‫Remember we use build.gradle to specify
‫the dependencies and libraries
‫that we are going to use inside of our project.
‫So this is one of them.
‫And there are two build.gradles, one
‫of which is project level, and the other one is app level.
‫We generally use app level build.gradle, but
‫in this case it asks us to use project level
‫and build that app level together.
‫So make sure you find both
‫of these files and make sure you edit them.
‫So first we are going to start with project level.
‫So I'm going to show you where it is located.
‫It's under gradle scripts
‫and the first one is project like this.
‫Just double click on this, okay?
‫And open it.
‫And there are some things that we need to check for.
‫For example, first of all, it says that check
‫that you have Google in your repositories.
‫And as you can see I have Google over here.
‫So if you don't have it, just write Google
‫with parenthesis and under dependencies
‫you have to copy this line from here class path
‫and paste it under your regular class path like this, okay?
‫And after that, again we have
‫another repository section where
‫we should add Google, and it's already over there for me.
‫So this is for the project level
‫build.gradle, and we are done.
‫Now we are back to the app level.
‫So let's go to the app level.
‫And here we have apply plugin like this over here.
‫Okay, so as you can see I already have it.
‫So under dependencies we should add for new SD case
‫and we are going to see how to do that, okay
‫with the following lecture.
‫But at the end of the line, at the end of the bottom
‫of this file, we are going to copy and paste this as well.
‫So this is what we need to do
‫in order to be ready for Firebase
‫But of course we are going to have to bring
‫in some additional dependencies
‫for this as suggested in the documentation.
‫So we are going to see how it's done in the next lecture.