1
00:00:00,170 --> 00:00:05,760
Hi everyone in this year Toli all we're going to go ahead and create another Android application.

2
00:00:05,760 --> 00:00:11,980
So just click on this start in your Android studio project and then for the name of the application

3
00:00:12,160 --> 00:00:21,800
just type in here app 58 and then click on next and here choose AP I-69 Android 4.1 Jelly Bean for minimum

4
00:00:21,850 --> 00:00:24,270
STK and then it could be next.

5
00:00:24,430 --> 00:00:28,930
And he had to choose empty activity next and then click on finish.

6
00:00:28,930 --> 00:00:32,210
So now as you can see here our project is created.

7
00:00:32,210 --> 00:00:37,750
So actually double click on the rest folder and then double click on the lay out folder here and then

8
00:00:37,750 --> 00:00:40,860
here double click on the activity underline made that example.

9
00:00:41,110 --> 00:00:45,860
So as you can see here now we can actually designed to use an interface of our application.

10
00:00:45,880 --> 00:00:49,100
So as you can see here we've got a rendering problems here.

11
00:00:49,130 --> 00:00:51,250
So are actually mixing styles.

12
00:00:51,280 --> 00:00:54,740
So when you actually choose the correct field for our application.

13
00:00:54,790 --> 00:00:59,200
So as you can see here I just need to click on this apophyses here and then he had actually Candie's

14
00:00:59,200 --> 00:01:04,610
material light and here choose this material that light that dark action.

15
00:01:04,790 --> 00:01:05,590
And in theory.

16
00:01:05,620 --> 00:01:06,240
OK.

17
00:01:06,400 --> 00:01:09,810
So as you can see here this is going to be the theme of my application.

18
00:01:09,970 --> 00:01:15,930
So now let's actually select this hello world text you here and then present delete key on your keyboard.

19
00:01:16,180 --> 00:01:21,500
So now it's actually the public Licinius activity underline minute example tap in order to make this

20
00:01:21,510 --> 00:01:22,970
a design area Vider.

21
00:01:23,170 --> 00:01:27,980
So first of all let's write a linearly out protocol into this relatively out here.

22
00:01:28,030 --> 00:01:33,640
So just select selectees linearly out here and just put it at the center of this relatively out here

23
00:01:34,120 --> 00:01:40,510
and now let's actually track some text fields into these linearly mathematical.

24
00:01:40,570 --> 00:01:44,590
So as you can see here inside these text fields Well there you've got these text fields.

25
00:01:44,740 --> 00:01:51,910
So just select is a plain text field here and put it at the center of this linearly as vertical and

26
00:01:51,910 --> 00:01:55,300
then it lets actually drag and order a plain text field here.

27
00:01:55,420 --> 00:01:57,360
Just select it and put it here.

28
00:01:57,550 --> 00:01:58,290
OK.

29
00:01:58,600 --> 00:02:04,300
And now I just select this first text with here and afford the ID just type in here.

30
00:02:04,320 --> 00:02:09,580
EDT our computer it is the computer name.

31
00:02:10,060 --> 00:02:16,010
And then press on entelechy on your keyboard and we have to select the second textfield here.

32
00:02:16,120 --> 00:02:24,160
Double click on it and for the ID just type in here it is the computer a type and then person enter

33
00:02:24,160 --> 00:02:25,320
key on your keyboard.

34
00:02:25,600 --> 00:02:29,400
So that is actually a sign a hint to the text with here.

35
00:02:29,500 --> 00:02:34,790
Just select this first place here and now let's actually find the hint attribute.

36
00:02:34,800 --> 00:02:37,260
So as you can see here this is the hint attribute.

37
00:02:37,270 --> 00:02:39,590
I just need to assign to just who they've here.

38
00:02:39,700 --> 00:02:49,450
Enter a computer name dot dot dot and in person in Tokyo on your keyboard and then select the second

39
00:02:49,510 --> 00:02:50,720
Topsfield here.

40
00:02:50,860 --> 00:03:00,590
And for the attributes assigned a value enter computer type and then person enter key on your keyboard.

41
00:03:00,820 --> 00:03:06,220
So now let's actually drag our linearly out horizontally into this linearly as vertical.

42
00:03:06,370 --> 00:03:14,080
So Enceladus layouts fall there just select it linearly or horizontal here and put it below these textfield

43
00:03:14,080 --> 00:03:20,090
here and now I want to actually drag two buttons into this linearly at horizontal.

44
00:03:20,140 --> 00:03:25,990
So here inside these widgets folder as you can see if you've got this button here just select it and

45
00:03:25,990 --> 00:03:31,420
put it inside these linearly or horizontal as you can see here in statis componentry section.

46
00:03:31,420 --> 00:03:37,000
Just put it inside these linearly as horizontal and now essentially the right and other a button into

47
00:03:37,000 --> 00:03:38,450
this linearly at what is on top.

48
00:03:38,530 --> 00:03:45,610
So just select the spot in here and put it inside linearly out horizontal here and now just select both

49
00:03:45,610 --> 00:03:46,700
of these buttons here.

50
00:03:46,810 --> 00:03:49,740
And for the layout out we assign the value zero.

51
00:03:50,170 --> 00:03:53,660
And for the lay out weight assigned the value 50.

52
00:03:53,710 --> 00:04:00,850
So now both of these buttons are going to actually take a half of its parents as you can see here that

53
00:04:00,880 --> 00:04:04,690
this linearly or horizontally is actually the parent of these two buttons.

54
00:04:04,690 --> 00:04:12,820
And now the width of these buttons are actually taking a half of the width of the parents which is this

55
00:04:12,880 --> 00:04:19,570
linearly or horizontal by assigning the value 0 for the lay out weight and assign the value number 50

56
00:04:19,720 --> 00:04:22,290
for the lay out wait for both of these buttons.

57
00:04:22,330 --> 00:04:25,700
As you can see here and that just select is a.

58
00:04:25,780 --> 00:04:27,220
First about in here.

59
00:04:27,220 --> 00:04:28,270
Double click on it.

60
00:04:28,450 --> 00:04:34,480
And for the text just type in here at and for the ID just type in here between ADD and then put a sun

61
00:04:34,720 --> 00:04:39,200
Enter key on your keyboard and then select is a second bottom here.

62
00:04:39,210 --> 00:04:41,890
Double click on it for the text just type in here.

63
00:04:41,900 --> 00:04:43,120
Delete.

64
00:04:43,870 --> 00:04:50,390
And for the ID just type in here between delete and then press on Enter key on your keyboard.

65
00:04:50,860 --> 00:04:55,330
So now I want to actually drag our list view into this linearly out vertical.

66
00:04:55,480 --> 00:05:01,630
So inside these containers fall there as you can see here we've got the list view here.

67
00:05:01,690 --> 00:05:06,090
Just select it and put it inside this linearly at vertical OK.

68
00:05:06,190 --> 00:05:12,200
Below it is linearly at horizontal and inside is linearly and vertical at the center of this linearly

69
00:05:12,200 --> 00:05:13,110
mathematical.

70
00:05:13,130 --> 00:05:15,820
So just put it here and double click on it.

71
00:05:15,890 --> 00:05:18,050
And as you can see here the idea is list view.

72
00:05:18,080 --> 00:05:21,870
So let's leave there leave the ID as default here.

73
00:05:22,280 --> 00:05:23,270
That's enough for us.

74
00:05:23,270 --> 00:05:26,830
We want to use that idea that default ID for our application.

75
00:05:27,020 --> 00:05:27,680
So just a.

76
00:05:27,770 --> 00:05:33,270
Let's go inside this main activity that I will find here and now I want to actually declare some objects.

77
00:05:33,350 --> 00:05:41,630
So I want to actually declare an edit text so Eddie takes it itty bitty computer name Karma.

78
00:05:41,690 --> 00:05:45,310
So here I can actually declare some objects that are actually of type.

79
00:05:45,320 --> 00:05:49,160
It takes in one line and the second object is going to be.

80
00:05:49,230 --> 00:05:57,810
Computer type Okay and then just put a semicolon at the end of your statement and then let's actually

81
00:05:58,020 --> 00:06:06,480
declare some objects of type button so Potin and the first object is going to be between and comma and

82
00:06:06,480 --> 00:06:10,770
now I want to actually declare another object which is of type button in one line.

83
00:06:10,800 --> 00:06:11,240
OK.

84
00:06:11,340 --> 00:06:21,210
Between delete and put a semicolon at the end of your statement and then let's actually declare another

85
00:06:21,240 --> 00:06:23,000
object which is of type list view.

86
00:06:23,130 --> 00:06:30,090
So here I can just type in list view list view and the name of the name of my object is going to be

87
00:06:30,090 --> 00:06:34,570
List View and then I need to put a semicolon at the end of my statement.

88
00:06:34,590 --> 00:06:36,610
So here inside is uncreate Smurfit.

89
00:06:36,610 --> 00:06:42,820
I want to actually instantiate these objects that they actually declare inside this main activity class.

90
00:06:42,840 --> 00:06:46,960
So here first what I want to actually to instantiate is EDT computer name.

91
00:06:47,100 --> 00:06:52,800
So here I can just say EDT computer name assignment operator and then here I just need to cast this

92
00:06:52,860 --> 00:07:00,660
object to a edit text object find view by ID are that Id Dud's EDT computer Terni and that I need to

93
00:07:00,660 --> 00:07:06,130
put a semi-colon at the end of my statement and then the second object is going to be EDT computer type.

94
00:07:06,270 --> 00:07:09,470
So EDT computer type assignment operator.

95
00:07:09,480 --> 00:07:17,160
And then I need to cast this object to a text object find the by ID are taught ID dot EDT computer type

96
00:07:17,460 --> 00:07:20,190
and then I need to put a semicolon at the end of my statement.

97
00:07:20,400 --> 00:07:23,960
And here I need to actually instantiate these button objects.

98
00:07:24,000 --> 00:07:30,270
So the first one is going to be between an assignment operator and then here I need to cast this object

99
00:07:30,270 --> 00:07:38,370
to a button object find view by ID or that ID that PETN add and that here I need to instantiate the

100
00:07:38,370 --> 00:07:42,800
speedy and delete object between the late assignment operator.

101
00:07:42,900 --> 00:07:49,200
Excuse me PTEN delete assignment operator and that he had any chance this object to a button object

102
00:07:49,600 --> 00:07:54,190
find view by ID or that Id dot PTEN delete.

103
00:07:54,480 --> 00:07:59,590
And then I need to put a semicolon at the end of my statement and here I want to instantiate this list

104
00:07:59,610 --> 00:08:00,330
view object.

105
00:08:00,340 --> 00:08:05,430
So here I just need to type in list view assignment operator and then here I just need to cast this

106
00:08:05,460 --> 00:08:14,670
object to a list view object find view by ID or that ID that list view and that I need to put a semicolon

107
00:08:14,670 --> 00:08:16,170
at the end of my statement.

108
00:08:16,230 --> 00:08:22,380
So as you can see here I just declare these objects and then inside is noncreative had I just instantiated

109
00:08:22,380 --> 00:08:23,470
these objects.

110
00:08:23,490 --> 00:08:30,630
So now let's actually create another Dava class named computer so that this class is going to actually

111
00:08:30,660 --> 00:08:34,710
hold the data that are related to the computer objects.

112
00:08:34,710 --> 00:08:38,700
So just selectees a package here that this I mean activity is inside it.

113
00:08:38,710 --> 00:08:39,170
Right.

114
00:08:39,270 --> 00:08:40,580
Just like this package.

115
00:08:40,590 --> 00:08:46,590
Right click on it and then you new and then Java class and then for the name of our class just type

116
00:08:46,590 --> 00:08:51,840
in here computer with Capitol C computer and then click on OK.

117
00:08:51,900 --> 00:08:54,950
So as you can see here our computer class is actually created.

118
00:08:54,960 --> 00:08:58,960
So let's actually declare some instance variables.

119
00:08:58,980 --> 00:09:05,520
So the first instance of it it's going to be int ID semicolon and the second instance variable is going

120
00:09:05,520 --> 00:09:15,490
to be of type string and the name of this string instance variable is going to be a computer name semicolon.

121
00:09:15,750 --> 00:09:21,360
And let's actually declare another instance variable which is of type strange and the name of this instance

122
00:09:21,360 --> 00:09:24,560
variable is going to be computer type.

123
00:09:25,050 --> 00:09:25,580
OK.

124
00:09:25,830 --> 00:09:31,760
So this class is responsible for holding Delk data that are related to the computer objects.

125
00:09:31,770 --> 00:09:35,580
So now as you can see here these are the instance variables of our computer class.

126
00:09:35,580 --> 00:09:36,090
Right.

127
00:09:36,120 --> 00:09:41,070
So I need to actually declare these instance variables as private instance variables.

128
00:09:41,100 --> 00:09:45,240
This is really important to remember that I told you in the top section of the course that you must

129
00:09:45,300 --> 00:09:51,990
always you should always declare your instance variables are private and then provide setters and get

130
00:09:51,990 --> 00:09:52,490
her.

131
00:09:52,890 --> 00:10:00,810
For this instance variables in order to allow other classes to access or for example to access or change

132
00:10:00,810 --> 00:10:03,350
the values of these instance variables.

133
00:10:03,540 --> 00:10:08,560
So first of all let me actually create some constructors for this computer class.

134
00:10:08,700 --> 00:10:13,980
So remember that I told you the access modifier of the constructor must be public.

135
00:10:14,160 --> 00:10:19,150
OK the name of the constructor must be the same as the name of this computer class.

136
00:10:19,230 --> 00:10:25,350
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

137
00:10:25,360 --> 00:10:27,640
these constructed by using these curly braces.

138
00:10:27,690 --> 00:10:30,630
So this is going to be the empty constructor OK.

139
00:10:30,780 --> 00:10:37,020
And this constructor actually implicitly calls the constructor of the superclass OK which is the object

140
00:10:37,020 --> 00:10:37,520
class right.

141
00:10:37,550 --> 00:10:46,350
So remember that I told you that all objects all classes are in Java actually inherits from the Object

142
00:10:46,350 --> 00:10:46,970
class.

143
00:10:47,000 --> 00:10:54,010
Ok it directly or indirectly this class actually directly inherit from the Object class.

144
00:10:54,100 --> 00:11:00,070
So the constructor of this computer class is actually implicitly calling the constructor of the superclass

145
00:11:00,430 --> 00:11:03,260
which is actually an empty constructor.

146
00:11:03,280 --> 00:11:03,810
OK.

147
00:11:03,970 --> 00:11:08,130
So this is going to be an empty constructor of our computer class.

148
00:11:08,140 --> 00:11:15,960
So I just create a comment here and then just type in here an empty an empty constructor.

149
00:11:19,640 --> 00:11:24,500
Of our computer class.

