So now I'm going to paste in some lines of code here inside the Smurfette.
Change the text of saint or update button according to the situation here.
And then I'm going to explain to you what's going on here.
So as you can see here these are the lines of code that I pasted here.
So here we have actually an if statement.
And here as you can see inside the Prentice's of this statement.
Here again I am using this takes you to this class in order to check whether this unique computer ID
valuable is empty or not.
Right.
So if takes you Teal's that is empty.
Junichi computer ID.
So if this computer is actually an empty valuable then this expression here evaluates to true and it's
going to go inside the curly braces of this statement and it's going to execute this line of code here
PTEN send or update data.
That said text.
And here as you can see here instead of double quotes we are saying that produce a new computer and
send it to server.
Right.
So here we want to change the text of this button.
Let me show you the emulator here if you want to change change the takes of this button for this value.
If this variable is actually empty.
Right so this variable actually determines what is going to be the text of this button.
If this value is empty then it's going to have this line of code here and it's going to put this value
as the text of this button produce in your computer and send it to server else.
So here is elist means that this computer ID is not empty right.
So if this expression evaluates to false.
This means that this computer ID is not empty.
You can imply that here.
So it's going to execute the SQL statement and it's going to actually execute this.
Else this line of code here PTEN sent or update data.
So here we are fed into this button that said text modify the used the computer data.
So here we are saying that it's going to actually update the produce computer.
OK.
It's going to update the already created computer.
So now that's you.
Nobody is going to be the purpose of this function.
As you can see now of you need to actually use this method here inside this method here produce in your
computer and put it in the database.
OK.
So that's why I put this here so that when they use that actually it has created a new computer then
it's going to check the text of this button.
According to the situation.
So hopefully that makes sense.
And now this is on Meffert right.
So if you need to add another method here so go inside the curly braces of this class.
So before the end in curly braces this class I'm going to paste in some more lines of code here and
then I'm going to explain to you what's going on here.
So as you can see here this is our Meffert here.
I pasted these lines of code here.
So here we have our method and the access modifier of this method is private.
The return type of this method is void and the name of this method is modified to produce the computer.
So this method is going to actually update the already created computer right.
It's going to update those data.
So when we use it it'll make sense.
I will explain it again.
So now just look at the Smurfette modify the Prudy's computer and this method accepts some arguments.
Right.
The first argument is of types 3 in computer name.
The second argument is a can of types 3 and it is computer power.
Here we have another argument stored in your computer to speed.
And this one strange computer ram strange computer screen strange computer keyboard and strange computer
c.p.
So these are the arguments of this method.
So now let's actually go inside the curly braces of this method.
And now I'm going to paste in some lines of code here.
So as you can see here these are the lines of code that I pasted here.
So look at this statement here.
Inside Apprentice's of this statement as you can see we have an expression.
And here we are saying that if not so as you can see here the exclamation mark here says not right.
So here we are saying if not takes you to the list that is empty computer name.
Right.
So here you are referring to this argument.
Here we are checking that whether this argument computer name is actually empty or not.
If the user has actually passed an empty value to this method or not.
So this is going to check that condition.
Here for me here we are saying that if not take city list that is empty.
Here we are saying that if the value of this argument is computer name which is of three it is not empty.
It is not actually an empty value.
Then this expression here evaluates to true and then it's going to go inside the curly braces of this
if statement and execute these lines of code.
Here inside the curly braces of this if statements.
But if this computer name argument is actually an empty value this expression it evaluates to false.
So this actually is exclamation mark here is very important here.
It is saying that if not takes you to it that is empty computer name if the value of this computer name
is not empty then in that case this expression evaluates to true and it's going to go inside the curly
braces of this if statement and execute the lines of code that are inside the curly braces of this if
statement.
Right.
So first you are taking that with this computer name right.
This argument is actually empty or not.
If it is empty then it's not going to execute this if statement if it is not empty then it's going to
go inside the curly braces of this if statement.
So here I am referring to this database reference.
Right.
So the state of his offense I told you actually already is already referring to the computers category.
So they have a self-install child.
So it's going to actually create a child inside that category which is this one unique computer ID.
And here as you can see here again we are treating this Janish computer ID as a child right.
So databased reference that child Janish computer ID dot to hide Junichi computer.
So this unique computer ID now is actually up Chatterley right.
So here we are creating a unique computer ID as the child of the computer skeptically.
And then here you are creating another child.
So here we are treating the unit the computer ID as a category right that child.
And now as you can see here we are specifying the key or the name which is computer name dot said value
computer name.
Right.
So here in this vein we can actually update our database in the Firebrace.
Right.
So here now after this if statement so I'm going to paste some more lines of code here.
So after the curly brace of this statement and inside the Smurfette I'm going to paste in some more
lines of code here.
So as you can see here these are the lines of code that I pasted inside this method modified to produce
the computer.
And now as you can see here again we have another statement.
And here we are saying that if again not take cities that is empty computer power.
So as you can see here I am fairly in to this arguments computer power.
If not take snootiness that is into computer power.
If the value of this computer power argument is not empty.
Right.
If the value that is passed to this method computer power this value is not empty then it's going to
go inside the curly braces of the if statement and it's going to execute these lines of code here.
Right.
So as you can see here inside this statement we have this try catch block.
So let's look at this try tribal like here.
So try and inside the curly braces of this try black as you can see we have some lines of code here.
So here first of all in line number 200 we are creating a variable which is of type integer and the
name of this variable is computer power in value.
Right.
Assignment operator and here I told you that this computer power when I actually create an object of
type A computer the value of the computer power is actually an integer value right.
So here we created up an argument which is of types 3.
So we need to convert that stream value to an integer value.
Right.
So that's what we are doing here.
In line number 200 We have a variable and the name of this variable is actually computer power into
value assignment operator.
And then here I am referring to the name of this class Integer right.
Integer dot parts in it.
So here I am calling this method on this class parse.
So this method is going to actually convert a string value to an integer value.
This is going to accept an argument of types 3 in and is going to convert That's think value to an integer.
And that's the value still must be an integer.
When I actually passed that integer value to add to it it takes that would be actually a string value.
Right.
So if you want to actually be converted to an integer value so integer that parsed means computer power
as you can see here I am passing this computer powered argument to the Smurfette So it's going to convert
that value to actually an integer value if that value is actually integer if that value is not integer
then it's going to actually execute this catch block.
It's not going to actually execute this triple-X here anymore.
It's going to execute these chats.
And in this case we can actually catch this error large.
All right.
And then first I need to specify the tag and for the second argument I can't just say I can refer to
the name of this argument exception.
So here let's change it to eat.
And here I can say eat that gets message semicolon.
Right.
So in this way we can catch the error and put it in the console so that we can actually see that error
and solved the error.
But now as you can see here we can't put it in the console.
And for example in the console it says that the value was not integer and the computer was not able
to actually convert it to an integer value.
But our application is not going to crash if we Cheche that error.
So it is very important that you put your codes that are actually throwing errors that may be throwing
errors inside the church catch block so that later your application may not crash.
This is very important.
You don't want your application to crash.
So now as you can see here integer parts into computer power and it's going to actually convert that
value to an integer value and it's going to assign that value to this computer power into value and
in line number of 210.
As you can see here I am referring to this database reference here.
Again this database reference is already referring to a category called computers.
Right.
We put that code inside our uncreate Meffert.
So now let me actually show you that code here let me scroll to the top here inside this uncreate Meffert
as you can see here we put this line of code here database so friends firebase database instance that
gets reference computers.
So now this database of friends is referring to these computers theatrically.
So everything we add to the state of his defense is going to be added to this computers category right.
So now let's actually scroll down here inside our own Meffert here again database reference inside Israel
black database or friends that type.
So I am referring to the computers category.
I am here creating a child for that computers category unique computer ID.
So this is the type of that category.
And here again I called this child Meffert undischarged.
So what I want to actually treat this idea Junichi computer ID as a category.
So that child computer power.
So this is going to be the key.
And Dot said value computer power in value.
Here we are updating the value of this computer power key right so in this way you can update your values
in the database.
So now we have this statement here right.
So after the end curly brace of this statement now I'm going to actually paste in some more lines of
code here.
Inside this method and then I'm going to explain to you what's going on here.
So as you can see here these are the lines of code that I pasted here inside the Smurfette.
Right.
So here again we have an order statement and here we are saying that if again not takes you to use that
is empty computer speed.
So as you can see here look at these arguments computer speed of typesetting.
Right.
So if not it a utility that is empty computer to speed then it's going to go inside the curly braces
of this if statement and it's going to actually execute this try catch block here.
So look at this trip like here is try and inside the curly braces of this Troy block we have these lines
of code here.
Try it.
Computer speed in value as you can see here we have actually an integer value.
Again this integer Raddy of an assignment operator.
And here we are calling this integer class that parse into computer speed.
So it's going to actually convert this computer to speed which is of type integer.
Look at this argument computer the speed of type of type stream.
Right.
So it's going to actually convert this computer speed which is of type strange an integer value.
Right.
And then it's going to actually assign an integer value to this computer to speed into value.
And if this piece of code here cannot convert this computer speed string value to an integer value then
it's going to actually execute this catch block right.
It's not going to execute the try block anymore and it's going to actually catch that error.
So and then I can actually catch the error here.
Lock thoughts.
And first I need to specify that page comma.
And here let's change the name of this argument to eat.
So eat thought get message semicolon.
So here inside is Troy block.
Again we are referring to the database defense which is already referring to the computers category
in the database and in the server on the server.
So database are Friendster child.
So the height of these database surface which is actually fed into the computer is critical it is going
to be you in each computer.
So this is the name.
This is the key of that type.
And here because we want to actually treat that idea that you need computer ID as a category.
Here you are calling the child on that category.
So database reference that child unit computer ID touch child computer Spaeth here you are referring
to the computer speed key data sets value computer speed and value as you can see here because we want
to actually update an integer value here as you can see.
We actually converted that computer to speed to an integer value.
Right.
So hopefully that makes sense.
And after the ending curly brace of this IIF statement as you can see here inside the Smurfette I'm
going to actually pasting some more lines of code here and then I'm going to explain to you what's going
on here.
So as you can see here these are the lines of code that I pasted here.
So here we have this IIF statement and here we are checking that.
If not takes you to realize that is empty computer around here we are saying that if these arguments
computer RAM which is actually of type strange as you can see here.
This is actually an argument right.
Computer crime types think this computer RAM which is of pipes three inch is not empty then it is expression
here evaluates to true and it's going to actually execute the lines of code inside this if statement.
As you can see here.
So here we have this a try block here as you can see.
So try and as you can see inside the curly braces of this trade like we have these lines of code here.
First of all as you can see the low number of 232 we have this variable which is a five integer Computerland
into value assignment operator.
And here I am referring to the name of this class Integer that parse.
And so this Smurfette is going to actually convert this computer ram argument which is of types 3 inch
to an integer value integer parts in a computer RAM and it's going to actually convert that string value
to an integer value.
But if this doesn't happen and if this method here fails then it's going to execute this catch statement
here.
This catch block and it's going to actually catch the catch the error.
So here inside this catch block I can say LUGG thought Oh.
And here inside the prentices first I need to specify the task and then I need to specify that I want
to try to get the error.
So let's change these are two.
And here I can see that gets message.
Semicolon exception right.
And now as you can see here of when this happens when this piece of code here is actually executed successfully
without any errors.
And if this computer is actually converted to an integer value here then it's going to assign that integer
value to the computer ran into value and now look at this line of code here in line number 234 database
reference that child unique computer.
So here you are referring to the height of that computer is critical to Junichi computer ID but child
computer ram as you can see here is key.
And here we are updating devalues set value computer right into value.
Right.
So when that user passes an integer value here they can actually update the value of that computer inside
that unit computer ID category.
So that's the job of this statement.
And now after the ending curly brace of this statement as you can see here after the curly brace of
this statement I'm going to pasting some names of some lines I've got here and then I'm going to explain
to you what's going on here.
So as you can see here these are the lines of code that I've pasted here.
We have actually an if statement.
And here again we are saying that if not Tick's utils that is empty computer screen.
Here we are taking that video to this computer the screen argument.
So as you can see here if I scroll to the top here look at the Smurfette we have this computer screen
Argive arguments right.
So here you are taking that whether this argument is actually an empty value or not if it is empty then
it's not going to actually execute this statement.
Right.
But it is not empty then it's then the expression evaluates to true.
And it's going to go inside the curly braces of this statement.
And this is and it's going I should say this line of code your database reference that child as you
can see here.
So here I am actually specifying the child of our computers category which is a unique computer ID and
that I am referring to the key computer the screen and that I am calling that set value you computer
the screen as you can see here this argument.
So in this way we can actually update the value of our computer screen.
So now after this if statement and insight is Millford again I'm going to pasting some more lines of
code here.
So as you can see here these are the lines of code that I've pasted here.
So again we have actually an if statement.
And here we are thinking that whether this actually the computer keyboard is empty or not.
So if not take a city that is empty computer keyboard.
So here we are referring to this argument which is of tapes 3.
So look at this argument here.
This is the best thing right.
So here you are saying that if this argument is actually an empty value then it's not going to execute
this statement.
OK.
But if these computer keyboard argument is not an empty value then it's going to go inside the curly
braces of this if statement and it's going to secure the sign I've got here a database reference that
child.
So here we are referring to the child of our database offense which is already referring to the computers
category.
So the child is unique computer ID that child.
And here I am referring to the actor the name to the key computer keyboard.
And here I am updating that set value in a computer keyboard.
Right.
So in this way we can actually update the value of this key inside this unique computer ID category
inside these computer skeptically.
So when I run my project you will see how this works.
And now I'm going to actually paste in some more lines of code here.
So as you can see here these are the lines of code that you pasted here.
So again we have an if statement here inside this method.
And here we are taking that if not takes you to list that is empty computer CPQ.
So here we are taking that with this computer you argument.
So now let me show you the argument here.
So as you can see here this is our computer C-p arguments right which is that I think.
So here we are checking that whether this computer C.P.R. argument is actually an empty value then it's
not going to execute this if statement but if not takes you to the list that is empty computer.
If this computer You argument is not an empty value then it's going to go inside the curly braces of
this if statement and it's going to go and and actually execute this thing in I've got here database
reference that child.
So here I am referring to the height of our actually computers category which is this one unit computer
ID and then we are calling this the height of that ID which is computers.
This is the key.
And then here we are updating the value of Diski computer Seip you that set value a computer CPQ right.
So now I'm going to pasting some more lines of code here inside this class.
OK.
So after the ending curly brace of the Smurfit as you can see here we get this method modified to produce
computer.
So after the ending curly brace of the Smif and before the ending curly brace of this class.
So inside this class I'm going to paste in some lines of code here.
So as you can see here these are the lines of code that I pasted here.
We have actually a method to write the axis modifier of this if it is private the return type of this
method is void and the name of the sum if it is computed they change listener.
Right.
So now let's get you to go inside the curly braces of the Smurfette.