So in order to actually or to import they require classes to our job or Foyles we need to actually click
on this android studio.
If you are using the Android studio on a Windows machine you need to actually click on file and then
settings.
OK so if you are using the Android studio on a Mac or a six unit you click on this android studio and
preferences and then just click on these gentled here and then click on auto gameport and then actually
change this in 0 to imports and paste to all.
And then check these checkboxes here OK and then click on OK.
So as you can see here now are the text of your class is imported to our main activity the java file
here.
As you can see now there is no error.
So now if we want to actually change the text of this text through here will your code.
I just need to type in here.
The one that said text.
And then I can actually put into double quotes and then inside the double quotes I can actually put
in my own text.
For example my own text.
OK.
And if I get on my project now and then I need to actually click on this.
OK here.
So as you can see here it's now going to actually start our application.
OK so as you can see here this is our text my own text.
OK.
So here I actually changed the text of this text through here via java code.
OK.
I guess I managed to successfully change the text of that text view here.
OK.
Now you want to actually show your and other a predefined class in Java called estrange tokenizer.
So first let me actually put in another text view.
Inside this screen here.
So just drag a large takes you to this screen here and here I need to actually give this text through
an ID.
OK.
So here I can I try to change the ID of these takes you to another value for example the two.
OK.
And now are inside this main activity that Java class I need to actually create another text view object.
OK.
So here I need to refer to the name of the text view class.
OK.
And then again I need to give this object a name t t to.
And then I need to put in an assignment operator here and then I need to put in a pair of round brackets.
And then again I need to refer to the name of the text class.
So as you can see here this is called casting.
OK.
In the next tutorial I'll talk more about casting in Java.
But for now just remember that you need to actually cast this object to text view object.
OK.
And make sure that you actually put this casting here and then we need to actually type in here find
view by id and then inside Apprentice's I need to type in our DOT ID that t t to.
OK.
And then I need to put in a semicolon at the end of my statement.
So now as you can see I created an object from this text to your class.
OK so this is how you actually create an object from this text view class.
OK.
So as you can see here this is how you can actually create an object from this text view class here.
OK so now that I created an object for this test class called T X2 I want to actually show you an other
predefined class in Java called Strange tokenizer.
So first I need to refer to the name of this train.
Tokenizer.
And then I need to give a name to this object.
For example for example Esti are object 1.
And then I need to put in an assignment operator here and then I need to put the new keyboard.
And then again I need to refer to the name of this string tokenizer class.
OK.
And then I need to put in a semi-colon at the end of my statement.
So as you can see here it's now showing us an error as you can see here.
When it's actually passing a string object to this constructor here.
OK so first we need to actually create a string object.
Strange for example as of one.
And then I need to put in an assignment operator and then I can initialize this object for example of
value some value.
OK.
And then I need to put in a semi-colon at the end of my statement.
OK.
So inside this prentices I can just refer to the name of this as the r object here.
And now you want to actually change the value of these textfield here by actually adding some Java codes
inside this main activity that Java fight.
OK.
So first I need to actually be to the name of this object here TXI the two dot said text and then inside
the prentices I can actually put in my own text.
So inside these practices I can just refer to the name of this Esty are object 1.
OK.
Dot next.
OK.
And if I write on my project now let's see what happens.
You can actually check this checkbox here that says Use same device for future launches and then it's
going to actually automatically run your project when whenever you want to run your Android project.
OK I can actually see the result.
OK Sam.
So as you can see here it's now showing us this text here some.
So where is this value here for here.
First of all I actually created another object from this text through class.
OK.
And here I actually created an object from this string class.
OK.
And I actually assigned a value to this string object.
OK.
And here as you can see I actually created an object from this string tokenizer class.
This is string tokenizer class is a predefined class in Java.
OK.
So as you can see here.
First of all I referred to the name of the string tokenizer class and then you gave a name to this object.
Is the R object one.
I actually used this new key word here in order to instantiate this object.
And again I referred to the name of this string tokenizer class and inside Apprentice's I've referred
to the name of this Esti are of one object.
OK.
The constructor of this strange tokenizer class accepts a value of type as 3.
OK.
And here I actually decided to change the text of this t XTi to object as you can see here.
And if I double click on this tab here you can see this text here.
OK.
I actually decided to change the value of that text here and I referred to the the name of this object
here.
Tastee to that set text and inside Apprentice's first of all I referred to the name of this object as
the object one dot next tawkin.
OK.
And it actually outputted this value here.
OK so what's going on here.
They created an object from this as three tokenizer class called Esti are object 1.
OK.
And here I actually instantiated this object by using this new keyboard here and I referred to the name
of this string tokenizer class here.
And I actually passed an argument to this constructor here.
OK so the type of this argument is as strange as you can see here.
OK.
So here this construct here uses the default delimiters which are blank spaces.
Papps new lines.
Carriage returns or forefeet characters.
OK so if any of these characters is contained in this thread and it is used to divide this three in.
OK.
So as you can see here we used this space character here.
OK some space value.
OK.
So that's why you only see this takes some here.
OK.
And if you for example want to change the value of this text here I just need to type in here t XTi
one dot set text and it inside Apprentice's.
I just need to refer it to the name of this is the object one dot next token.
And if I put on my project now let's see what happens.
So as you can say this is our value here are some value.
OK.
So now let me repeat again.
We created an object from this as thrain tokenizer class called Esti are object 1.
And here I instantiated this object by using this new keyboard here.
And here I referred to the name of this string tokenizer class and I passed an argument to this constructor
here and arguments to this constructor here.
So the type of this argument is strange OK.
The are one.
OK.
And here the value of this Esti or one object as you can see is some space value as you can see here.
OK.
So here this constructor here uses the default delimiters which are blank spaces Papps or new lines.
OK.
So as you can see here we have a blank space here.
OK.
So that's why we only see this text here Sam.
And here we see this taste here right.
You ok.