So hopefully that makes sense.
And as you can see we created these objects here and now we can actually interact with these objects
inside this screen.
OK.
OK everyone.
Now let's actually typing here PTEN result that sets on Cleage listener new view that Uncle listener.
OK.
So as you can see here I made the Spartan to listen to the clique's that the user make on this button.
And then it can actually execute some codes that we actually put inside these curly braces inside the
curly braces of this unplugged Meffert.
OK.
So now I want to actually read the value that the user actually enter inside these textfield here.
And then I were to actually read that value and then when the user click on the spot in here I want
to get that value and then put that value inside these text.
View here.
OK.
So let's see how we can do that.
OK.
Inside this unclear it first actually create a string object and let's actually give a name to this
string object.
For example text field value.
And then I put an assignment operator here and then I actually refer to the name of this text object.
OK.
EDT the number.
Get text dot to strange OK.
If if I actually don't put this to a string Meffert Let's see what happens.
As you can see it's now showing us an error.
So as you can see let's actually hover our mouse pointer over this area and see what happens.
It says incompatible types require Java or to land that string found Android that text that editable.
So as you can see here because you're actually creating a value of type screen we need to assign a value
of string to this value.
But as you can see here this is the number that gettext actually returns a value of type editable.
OK.
And that's not compatible with this string object.
So here there are two ways that we can to actually convert this returned value to a string value.
You can just type in two streams or you can just put an A-plus operator here.
And then you can just put into double quotes.
OK.
And in this way we are actually converting this value to us string value.
And then we are assigning data value to this string object.
OK so here we are actually getting the text that is inside of this.
It is number object located inside of this text field here.
OK remember that we actually gave up an ID to this textfield object as you can see it is the number.
So now I am actually reading the text that is inside of these EDT.
Number object.
And now I want to actually put that right to you or a sign that read you to this directive result object.
So here I can just type in TXI the result that said text.
And then inside Apprentice's I can just revert to the name of this object textfield value.
OK.
Let's actually run our project and see what happens.
So as you can see here now our application is running on this emulator.
Now let's actually enter a number into this text field here.
OK.
So for example number 54.
OK.
So now let's actually click on this.
Show me the result button here as you can see.
Now the text of this text is changed and this value is here 54.
OK.
So another important point that I want to actually show you is that.
So as you can see here this uncreate me if it actually is called when ever that we actually run our
application.
So when our application is actually started this method is going to be called and the codes inside of
this method is going to be called once only once.
OK.
So as you can see here I've created some objects from this text view class from this area text class
and from disputant class.
And as you can see here the Android studio Id actually put this final cheap keyboard before these two
objects automatically for us.
So and that means these objects is going to be constant and we cannot actually change the value of these
constants.
Once we assign a value to these constants.
OK.
So here as you can see I actually assigned the value of this text the value the value of these textfield
value object to this takes the result object here.
OK.
And I cannot actually refer to another value or to another object and then assign that why do you treat
this object.
Or you can only access the value of this object and the value of this object is the value of the EDT
number textfield here.
OK.
So whenever we actually putting a text inside these textfield here that value is going to be assigned
to these T it's the result here.
OK.
So here I can actually delete this number and I can actually assign an order value.
And if I actually click on the spot in here as you can see this value is changed.
OK.
Because you are actually reading from this textfield object.
This takes real object is an object of type string.
And here you are actually assigning the value of that is inside of these textfield object a key number
that get fixed.
And here you are actually converting this value to a string value in order to assign this value to these
textfield value object.
OK.
So hopefully that makes sense.
And now I want to actually use the if statement here in order to show you how to use this control statement
in.
In our Android applications.
OK.
So now I can actually typing in here if and now inside Apprentice's I can just put up an expression
here that's actual results in a true or false value.
We can only put a value of type.
True or false or and that results in a true or false value.
So let me show you that.
So here for example I want to specify that when ever that a user putting a number 51 into this or textfield
here I want to actually put in another text beside that result.
So let me show you that for example a text if text field value that contains and that inside the apprentice's
I can just put in the wall 51 here and then I need to actually open and close my statement by using
these curly braces.
So now let me actually cut this line of code here.
And let's actually put this line of code here.
And now I can actually concatenate this value with another value for example.
Great.
OK.
So let's actually run our project and see what happens.
OK everyone.
Now as you can see here I need to actually enter a value here.
OK.
So for example I can actually put in a number here for example number 50.
OK.
So if I actually click on this button here let's see what happens.
So as you can see here nothing happened.
OK.
So what's going on here.
So as you can see here inside this unclick Smurfette as you can see we are actually getting the value
of these EDT.
Number textfield here OK the value of this text here.
OK.
And we are actually assigning that value to this string object.
OK.
Textfield value.
And here we are actually creating actually an if statement in order to actually specify that if only
the value of these are textfield is 51.
It's going to actually execute this line of code here.
But if the value of these textfield value as you can see the value that is inside of these attacks will
here is not 51.
It is not going to execute any line of code here because we didn't specify that when the value of this
textfield is not 51.
So what should be done.
So now I can actually putting in an else statement here and now I actually opened and close this statement
here by using these curly braces I can actually put in another line of code so I can just type anti-X
the result that said text.
And then inside Apprentice's I can just put in two double quotes here and I can just typing in the value
is not 51.
OK.
And the value is.
And then I can actually concatenate this value with the value of these textfield value OK.
So I can just type in here it takes me or do I do.
So now as you can see for example if we actually change this number to number 51 and if I actually click
on this.
Show me the results button here.
As you can see it says 51.
Great.
OK.
So it did actually execute this line of code here.
OK.
Inside of these statements because these textfield actually contains this value 51.
OK so now let's actually run our project again and let's see what happens.