Hi everyone in this year Toli all we're going to go ahead and create another Android application.
So just click on this start in your Android studio project and then for the name of the application
just type in here app 58 and then click on next and here choose AP I-69 Android 4.1 Jelly Bean for minimum
STK and then it could be next.
And he had to choose empty activity next and then click on finish.
So now as you can see here our project is created.
So actually double click on the rest folder and then double click on the lay out folder here and then
here double click on the activity underline made that example.
So as you can see here now we can actually designed to use an interface of our application.
So as you can see here we've got a rendering problems here.
So are actually mixing styles.
So when you actually choose the correct field for our application.
So as you can see here I just need to click on this apophyses here and then he had actually Candie's
material light and here choose this material that light that dark action.
And in theory.
OK.
So as you can see here this is going to be the theme of my application.
So now let's actually select this hello world text you here and then present delete key on your keyboard.
So now it's actually the public Licinius activity underline minute example tap in order to make this
a design area Vider.
So first of all let's write a linearly out protocol into this relatively out here.
So just select selectees linearly out here and just put it at the center of this relatively out here
and now let's actually track some text fields into these linearly mathematical.
So as you can see here inside these text fields Well there you've got these text fields.
So just select is a plain text field here and put it at the center of this linearly as vertical and
then it lets actually drag and order a plain text field here.
Just select it and put it here.
OK.
And now I just select this first text with here and afford the ID just type in here.
EDT our computer it is the computer name.
And then press on entelechy on your keyboard and we have to select the second textfield here.
Double click on it and for the ID just type in here it is the computer a type and then person enter
key on your keyboard.
So that is actually a sign a hint to the text with here.
Just select this first place here and now let's actually find the hint attribute.
So as you can see here this is the hint attribute.
I just need to assign to just who they've here.
Enter a computer name dot dot dot and in person in Tokyo on your keyboard and then select the second
Topsfield here.
And for the attributes assigned a value enter computer type and then person enter key on your keyboard.
So now let's actually drag our linearly out horizontally into this linearly as vertical.
So Enceladus layouts fall there just select it linearly or horizontal here and put it below these textfield
here and now I want to actually drag two buttons into this linearly at horizontal.
So here inside these widgets folder as you can see if you've got this button here just select it and
put it inside these linearly or horizontal as you can see here in statis componentry section.
Just put it inside these linearly as horizontal and now essentially the right and other a button into
this linearly at what is on top.
So just select the spot in here and put it inside linearly out horizontal here and now just select both
of these buttons here.
And for the layout out we assign the value zero.
And for the lay out weight assigned the value 50.
So now both of these buttons are going to actually take a half of its parents as you can see here that
this linearly or horizontally is actually the parent of these two buttons.
And now the width of these buttons are actually taking a half of the width of the parents which is this
linearly or horizontal by assigning the value 0 for the lay out weight and assign the value number 50
for the lay out wait for both of these buttons.
As you can see here and that just select is a.
First about in here.
Double click on it.
And for the text just type in here at and for the ID just type in here between ADD and then put a sun
Enter key on your keyboard and then select is a second bottom here.
Double click on it for the text just type in here.
Delete.
And for the ID just type in here between delete and then press on Enter key on your keyboard.
So now I want to actually drag our list view into this linearly out vertical.
So inside these containers fall there as you can see here we've got the list view here.
Just select it and put it inside this linearly at vertical OK.
Below it is linearly at horizontal and inside is linearly and vertical at the center of this linearly
mathematical.
So just put it here and double click on it.
And as you can see here the idea is list view.
So let's leave there leave the ID as default here.
That's enough for us.
We want to use that idea that default ID for our application.
So just a.
Let's go inside this main activity that I will find here and now I want to actually declare some objects.
So I want to actually declare an edit text so Eddie takes it itty bitty computer name Karma.
So here I can actually declare some objects that are actually of type.
It takes in one line and the second object is going to be.
Computer type Okay and then just put a semicolon at the end of your statement and then let's actually
declare some objects of type button so Potin and the first object is going to be between and comma and
now I want to actually declare another object which is of type button in one line.
OK.
Between delete and put a semicolon at the end of your statement and then let's actually declare another
object which is of type list view.
So here I can just type in list view list view and the name of the name of my object is going to be
List View and then I need to put a semicolon at the end of my statement.
So here inside is uncreate Smurfit.
I want to actually instantiate these objects that they actually declare inside this main activity class.
So here first what I want to actually to instantiate is EDT computer name.
So here I can just say EDT computer name assignment operator and then here I just need to cast this
object to a edit text object find view by ID are that Id Dud's EDT computer Terni and that I need to
put a semi-colon at the end of my statement and then the second object is going to be EDT computer type.
So EDT computer type assignment operator.
And then I need to cast this object to a text object find the by ID are taught ID dot EDT computer type
and then I need to put a semicolon at the end of my statement.
And here I need to actually instantiate these button objects.
So the first one is going to be between an assignment operator and then here I need to cast this object
to a button object find view by ID or that ID that PETN add and that here I need to instantiate the
speedy and delete object between the late assignment operator.
Excuse me PTEN delete assignment operator and that he had any chance this object to a button object
find view by ID or that Id dot PTEN delete.
And then I need to put a semicolon at the end of my statement and here I want to instantiate this list
view object.
So here I just need to type in list view assignment operator and then here I just need to cast this
object to a list view object find view by ID or that ID that list view and that I need to put a semicolon
at the end of my statement.
So as you can see here I just declare these objects and then inside is noncreative had I just instantiated
these objects.
So now let's actually create another Dava class named computer so that this class is going to actually
hold the data that are related to the computer objects.
So just selectees a package here that this I mean activity is inside it.
Right.
Just like this package.
Right click on it and then you new and then Java class and then for the name of our class just type
in here computer with Capitol C computer and then click on OK.
So as you can see here our computer class is actually created.
So let's actually declare some instance variables.
So the first instance of it it's going to be int ID semicolon and the second instance variable is going
to be of type string and the name of this string instance variable is going to be a computer name semicolon.
And let's actually declare another instance variable which is of type strange and the name of this instance
variable is going to be computer type.
OK.
So this class is responsible for holding Delk data that are related to the computer objects.
So now as you can see here these are the instance variables of our computer class.
Right.
So I need to actually declare these instance variables as private instance variables.
This is really important to remember that I told you in the top section of the course that you must
always you should always declare your instance variables are private and then provide setters and get
her.
For this instance variables in order to allow other classes to access or for example to access or change
the values of these instance variables.
So first of all let me actually create some constructors for this computer class.
So remember that I told you the access modifier of the constructor must be public.
OK the name of the constructor must be the same as the name of this computer class.
As you can see here and then I need to put a pair of Prentice's here and then I need to open and close
these constructed by using these curly braces.
So this is going to be the empty constructor OK.
And this constructor actually implicitly calls the constructor of the superclass OK which is the object
class right.
So remember that I told you that all objects all classes are in Java actually inherits from the Object
class.
Ok it directly or indirectly this class actually directly inherit from the Object class.
So the constructor of this computer class is actually implicitly calling the constructor of the superclass
which is actually an empty constructor.
OK.
So this is going to be an empty constructor of our computer class.
So I just create a comment here and then just type in here an empty an empty constructor.
Of our computer class.