Let's actually learn our project here.
So just click on this button here and now it's going to run our application here.
So now let me show you the web browser here.
And here is our web browser here.
And now let me show you the emulator.
So now let me check here.
Now as you can see it is actually luncheonette application.
And here it is saying that instead Thrun applied code changes and restarted the app.
So now our application is ready.
So now let me show you the web browser and the emulator.
So now I want to specify the computer name right.
So here I can see that my computer name is iPhone iPhone for example 5.
Right.
And the computer power is one example of one thousandth the computer's speed is 2000.
The computer room is five thousand as you can see here.
And computer screen is retina touch screen
screen as you can see here touch screen computer keyboard is virtual here.
I can say for example virtual keyboard right virtual keyboard.
And now let me make this cheap virtual keyboard here actually disappeared.
We have the computer CPO So here I can say Apple C.P. you right.
So now as you can see here we have these data and here as you can see the text of this button is produced
in your computer and sent it to server.
So you already know why this text is here because let's go to Android studio.
As you can see here inside this uncreate Smurfette Let me show you the angry at me.
This is our uncreate method right.
And here as you can see we put this line of code here to change the text of send or update button.
According to the situation.
So this uncreate Meffert here is going to be actually called when the user actually opens the application
right.
And now as you can see here it's going to actually look at this line of thought here and it's going
to execute the Smurfit.
So now let me actually hold the comment here on my keyboard.
And if you are using a Windows machine you need to actually just hold the control on your keyboard and
then click on this line of code here.
This method as you can see now as you can see here this is our Meffert right.
Private's will it change the text of send or update button.
According to the situation and it's going to actually look at the value of this unique computer I.D.
It's going to check that this barrier is actually empty or not if it is empty then it's going to actually
set the text produced in your computer and send it to server.
So as you can see here this is that value and that that means that the value of this unique computer
ID now is empty.
Right.
And if it if it is not empty then it can actually be said this text here modified to produce computer
data.
So now let's actually click on this button.
Now as you can see here as you can see here the text fields are empty.
Now let's go to our web browser and here you can see that the data is on here.
Right.
So here we have these computers category.
So I told you about this computers category.
Right.
Because let's go to our Android studio.
As you can see here inside our uncreate Smurfette here in line number are actually in line number six
the eight as you can see.
You referred to this database reference assignment operator.
And then I refer to these firebase database instance.
So let me show you the web browser.
So this is our firebase database instance right.
This is our firebase database instance that gets reference so now I want to actually get a reference
to the computers category.
So we created this chattily computers category and then we clicked on their produce and and you actually
computer object right.
So let's look at our Mefford produce in your computer object.
So as you can see here let's find RMF So this is RMF it produce a new computer and put it in the database.
So when I clicked on this on this button as you can see here and at the takes of this button is modified
to produce the computer data.
So now we can actually update that data.
But now when I first click clicked on the spot and when I actually hear the computer data.
And and first clicked on this button first it actually executed this method produce in your computer
in the database and put it in the database as you can see here for this kind of Chafer that this up
this unique computer ID value.
But it's actually actually empty or not if it is empty then it's going to have the same effect here
and it's going to create our Random unique ID right database that the database reference that push.
So this piece of code here is going to actually create a random unique ID in the day in the firebase.
So now let me show you the web browser as you can see here.
Inside this computers category we have this random unique ID.
Right.
So that's the job of this piece of code here.
Database reference that push right this unique ID and then we call the gate key.
So it's going to actually get this value and assign it to this unique computer I.D. because of tapes
3.
Right.
And then it's going to create a computer object with the values that we pass to the Smurfette so we
pass these values.
For example the computer is Apple's CPQ right.
He created these values.
These values for this object.
And here now we have this object.
And here we said database reference.
So this database difference now is actually referring to these computers category right.
And here we are saying that child unique computer ID.
So here we are referring to this.
And here you are saying that set value computer.
So it's going to actually treat this idea as a category because we are actually sitting on an object
to this child.
So it's going to actually pro-white keys and values according to the actually the names of the instance
variables of this object.
So let's go inside our computer class as you can see here we have this instance variables inside this
class.
Look at these kids here for example computers CPQ.
Right.
So let's find the computer see you here as you can see it's going to look at this value computer spew.
And it's going to put it as the key as it can here as the key of our value app LCP you right.
It's just the same key.
Or for example look at these key computer keyboard as you can see here.
Now we have this the name of this instance valuable as you can see here.
This is the same or computer name.
Here we have computer name or there for example computer power.
Here we have computer power or for example a computer up speed here.
Here we have computers speed or computer RAM.
Here we have computer RAM and so on.
Right.
So let's go back to human activity of a fight as you can see here.
We set our objects to produce ID and then as you can see here it actually treated this key as the category
and put these keys and values here.
Right.
And here it's got it actually changed the text of our button as you can see here.
Now the text of this button is changed.
Right.
Why.
Because now this unique computer ID is not empty.
Right.
So this unique computer ID now has a value.
So instead it's going actually up there so you actually click on this button again.
So now let's actually go inside our uncreate method here.
Let me show you that here Betty and sent or updated data right.
That's listener first that first.
When we click on the spot in as you can see it's going to get the values of these take the texts and
it's going to assign them to these other variables.
And it's going to execute these lines of code here and then it's going to actually look at these IIF
statement here at this if else statement.
And it says it takes utility that is into your computer ID.
So now as you can see here because you can get your computer ID has value.
Now this expression here evaluates to false.
Why.
Because you need a computer ID is not empty this valuable unique computer ID has a value has a value
right.
So there's a solution here evaluates to false and it's not going to execute this statement.
Instead it's going to execute this.
Else they meant and it's going actually be modified to produce the computer here.
Right.
Modified to produce a computer.
And here I can actually update that actually the values the date of my computer.
So for example as you can see here we called the Smurfette and we passed the computer name power speed
RAM screen keyboard Seip you get these values from these texts.
So let's actually go to our web browser here.
And now let me show you the emulator here.
So this is our emulator and this is our web browser right.
So now for example I decide to actually change the value of my computer speed.
So as you can see here.
Let's let's look at our computers here.
This is 2000 right.
Let's change this value to for example of 5000.
Right.
So now let's just click on this button modified to produce computer data.
And now it's going to actually update the value of this computer speed.
Right.
So let's for example change the name of my computer to for example iPhone 4 iPhone 4.
Right.
So now I want to update the name the name of my computer.
I don't want the iPhone 5 s for example I want this iPhone 4.
So let's click on this button here modified to produce computer data and now it says iPhone 4 or here
we can also say for example galaxy Galaxy 5.
And then if you click on this button again now again it's going to update the name of my computer or
here I can say for example physical and physical keyboard.
And then if I click on this button here.
Now as you can see here this data is actually updated.
So hopefully that makes sense.
And now that we actually since these data to the server we have these objects right with this ID.
Now I want to get this data from the server.
So let's actually click on the spot and get data from server.
And now you can see these data here.
Right.
We successfully got this data from the server.
So for example as you can see here these text view is actually inside a horizontal scroll view.
So that's why you can see that I can actually scroll here to the left or right.
In order to see the values and it says computer name is Galaxy 5 dash computer power is 1000 dash computer
speed is 5000.
As you can see here the computer that is 5000 computer screen and these values here.
Right.
So let's actually change for example change the computer name here.
Now let's see that how this actually is going to be updated.
So let's change the computer name here.
For example I can't say that I want my computer name to be for example matchbooks pro MacBook Pro.
Right.
And now if I actually press on until here on my keyboard as you can see here these values must be inside
to double quotes because this is going to be a stunning value.
So here I have a MacBook Pro and in-person interview on your keyboard.
And now let me show you the the emulator here and here it is saying that the computer name is Mac which
pro it has successfully got the data from the server.
So when I change the data here it's going to also change this data here so we can also update data here.
For example I can say that the computer for example the computer you should be for example code I-78
core is 7.
So now if I click on the spot in here I'll modify it to produce the computer data.
As you can see here now here the computer name is Galaxy 5 because we actually passed this value as
the computer name the computer's speed is 5000 here.
As you can see and the computer CPO Let's actually scroll to the left as you can see the computer is
called Seven.
So when you update these data here these data and I actually get this data from the server.
These data are also going to be updated.
Right.
This is very fast.
A firebase is the best backend if you want to actually create applications that use that needs to be
actually connected to the server which is the best.
This is very fast.
So now for example if I actually want to just just let me actually close this application here for example.
Now I want to close this application here and this one and this one right.
So now let's actually run our application again.
So the name of our application was absolutely for right.
And now as you can see here again when we actually run our application here the value of our let me
go to our Android studio.
The value of our valuable Junichi computer ID again it is actually empty right.
So then I actually want to create another instance.
So let me show you the web browser and this one.
So this actually create another computer for instance.
So the name of my computer this time is for example Windows Windows PC.
Right.
And the computer power is 2000 computer it is 3000 Computerland is 4000 right.
The computer screen is for example touch screen touch screen the computer keyboard is for example virtual
and the computer is called I fight.
For example quote I fight.
And now if I click and click on this button here let's see what happens.
Produced in your computer and send it to server right.
And now it's going to actually create another instance and other ID inside these computers category.
Right.
And here as you can see we have these data computers C-p you call like five virtual computer keyboard
a computer keyboard is virtual computer name is Windows PC computer.
However it's 2000 computer Ramey's 4000 computer screen is touchscreen and the computer speed is 3000.
And now let's click on the spot and get data from server.
And now we get that data of this instance.
Right.
Computer Name is Windows PC computer power is 2000 and all these data.
Right.
So you can scroll and see all these.
So I think that's it.
And now we can actually figure out how to actually send data to the server and to how to update it how
to get it to get data from the server.
And if we're going to actually create more and more applications and connect them to our firebase database
in order to learn more topics in order to learn more concepts about using firebase as the backend about
applications.
For now just this is enough and if you have any questions about these concepts that I taught you please
post the discussion in the course and then I'll do my best to answer all of your questions.
Thank you very much for watching and I'll see you in the next year Tauriel.