1
00:00:00,390 --> 00:00:06,540
So now before we add the logic to our main activity the double file here let's actually open our project

2
00:00:06,540 --> 00:00:11,020
structure so we just click on this view tool windows and then click on Project.

3
00:00:11,070 --> 00:00:11,850
Right.

4
00:00:11,850 --> 00:00:14,570
So now this is the structure of our project.

5
00:00:14,580 --> 00:00:21,630
And these are the files and non-sexually click on this app here at the top and then click on file and

6
00:00:21,630 --> 00:00:24,060
here click on project structure.

7
00:00:24,480 --> 00:00:30,930
And now as you can see in this industry Julio's I'm going to actually use the latest AP AIs that are

8
00:00:30,930 --> 00:00:37,810
introduced in the latest job right in the latest version of actually Java programming language.

9
00:00:38,220 --> 00:00:42,510
So now let's as far as you can see we have this sort of compatibility right.

10
00:00:42,510 --> 00:00:47,050
So just click on this here and then choose 1.7 Java 7.

11
00:00:47,460 --> 00:00:50,990
And again choose this one here and choose 1.7.

12
00:00:51,150 --> 00:00:51,800
Right.

13
00:00:51,840 --> 00:00:58,830
So as you can see here for the source composite compatibility I chose 1.7 and for their target compatibility

14
00:00:58,830 --> 00:01:00,940
I chose 1.7 right.

15
00:01:01,240 --> 00:01:07,110
And now let's actually click on OK here and now we should wait a little bit here is going to actually

16
00:01:07,380 --> 00:01:09,400
build the cradle here for us.

17
00:01:09,720 --> 00:01:12,670
And as you can see here everything is done here for us.

18
00:01:12,690 --> 00:01:13,340
Right.

19
00:01:13,500 --> 00:01:19,280
So now let's actually go inside this main activity that double file here and now first of all inside

20
00:01:19,290 --> 00:01:24,330
this main activity class I'm going to paste in some lines of code here and then I'm going to explain

21
00:01:24,330 --> 00:01:26,680
to you what's going on here.

22
00:01:27,060 --> 00:01:31,980
So as you can see here these are two lines of code that are pasted here.

23
00:01:32,190 --> 00:01:38,520
So in line number 12 as you can see we have a constant which is actually public static as you can see

24
00:01:38,520 --> 00:01:41,760
here and the data type is streamed.

25
00:01:41,940 --> 00:01:42,660
So this is fine.

26
00:01:42,670 --> 00:01:48,300
Right this is constant and the name of this constant is guesses as you can see here all the letters

27
00:01:48,330 --> 00:01:53,660
of this name is actually capitalized cases and that I've with an assignment operator here.

28
00:01:53,760 --> 00:01:59,290
And then I assigned this string the value to this constant setting's underline number of guesses.

29
00:01:59,310 --> 00:01:59,950
Right.

30
00:02:00,060 --> 00:02:01,270
So what is its value.

31
00:02:01,440 --> 00:02:05,920
So let's actually go inside this quiz underlying preferences that they simplify.

32
00:02:06,060 --> 00:02:09,860
And now as you can see here at the top we have this list preference right.

33
00:02:09,870 --> 00:02:13,240
We have a radio group that contains radio buttons.

34
00:02:13,470 --> 00:02:19,400
And now as you can see here the key is 13 x underly number of guesses.

35
00:02:19,410 --> 00:02:27,720
So as I told you before we actually use this key in order to interact with this least preference in

36
00:02:27,720 --> 00:02:31,470
order to interact with this radio group that contains radio buttons.

37
00:02:31,530 --> 00:02:38,280
So we must provide a key for our release preference so that later in our job codes we can and we can

38
00:02:38,430 --> 00:02:44,820
actually interact with this list through friends and the key is settings underline number of guesses.

39
00:02:45,000 --> 00:02:49,800
Now if we go back inside this main activity that our file here as you can see this is that keep settings

40
00:02:49,830 --> 00:02:51,220
on the number of cases.

41
00:02:51,240 --> 00:02:56,630
So here I actually created a constant so that whenever I actually referred to this case as constant

42
00:02:56,670 --> 00:02:58,030
I can actually access this value.

43
00:02:58,050 --> 00:02:58,310
OK.

44
00:02:58,320 --> 00:03:03,920
There is no need to write at this value every time I need to actually access this key.

45
00:03:04,020 --> 00:03:10,170
I can't just refer to this case as constant right in line number 13 as you can see here we have another

46
00:03:10,170 --> 00:03:13,010
constant public static final strange.

47
00:03:13,200 --> 00:03:19,820
And this animal underling type assignment operator and again we assigned another key to this constant.

48
00:03:19,920 --> 00:03:23,290
And the key is settings underline and Namath's type.

49
00:03:23,340 --> 00:03:27,360
So if you actually go inside this quiz underline preferences that examen find.

50
00:03:27,400 --> 00:03:35,070
Now you can see that we have this multi-select list preference as you can see here we have these checkboxes.

51
00:03:35,460 --> 00:03:43,020
We have as you can see now you can see that the key is settings on the line and the months type.

52
00:03:43,020 --> 00:03:44,580
So this is that key here.

53
00:03:44,580 --> 00:03:45,420
Right.

54
00:03:45,570 --> 00:03:49,650
So now let's actually go back inside our main activity that of our file here.

55
00:03:50,010 --> 00:03:57,020
And we have also another constant public static final string and the name is quis on the line back in

56
00:03:57,180 --> 00:03:58,280
Underland cutter.

57
00:03:58,470 --> 00:04:03,420
And as you can see here this is the key settings underlined keys underlined by get an underlined color.

58
00:04:03,450 --> 00:04:07,560
So if you actually go inside the school is underlined preferences that examen file.

59
00:04:07,560 --> 00:04:14,230
Now you can see that the key for this list friends here as you can see is this one settings under the

60
00:04:14,240 --> 00:04:17,170
line crease underlined background underlined color.

61
00:04:17,230 --> 00:04:18,160
Right.

62
00:04:18,180 --> 00:04:22,710
So we actually referred to the ski inside our main activity out of a file.

63
00:04:23,040 --> 00:04:28,760
And here we have another constant public static final three in front.

64
00:04:28,860 --> 00:04:35,360
And again we assigned another key to these constant settings on the line quiz underlined font.

65
00:04:35,490 --> 00:04:40,470
And if we actually go inside this quiz underline preferences that is simplified you can see that you

66
00:04:40,470 --> 00:04:41,790
are referring to this key here.

67
00:04:41,790 --> 00:04:42,110
Right.

68
00:04:42,120 --> 00:04:46,810
This is the key settings underline quis underlined font right.

69
00:04:46,980 --> 00:04:51,160
So let's actually go back and say there's an activity in say these entity that have a file here.

70
00:04:51,270 --> 00:04:56,280
And as you can see here we have all these keys here inside this main activity that double file inside

71
00:04:56,280 --> 00:04:57,590
this main activity class.

72
00:04:57,690 --> 00:04:58,330
Right.

73
00:04:58,620 --> 00:05:01,860
So hopefully that since.

74
00:05:01,940 --> 00:05:04,570
Now I want to show you another important thing here.

75
00:05:04,730 --> 00:05:10,270
If you actually have noticed before that our application is going to be an import in portrait mode.

76
00:05:10,370 --> 00:05:11,090
Right.

77
00:05:11,090 --> 00:05:13,370
So let's actually open our project structure.

78
00:05:13,370 --> 00:05:18,560
And as you can see here I just need to double click on this manifests here as you can see here for this

79
00:05:18,560 --> 00:05:20,300
activity here for this main activity.

80
00:05:20,300 --> 00:05:26,780
I want to add another attribute and here I can just type in orientation and here as you can see it says

81
00:05:26,820 --> 00:05:32,750
all screen orientation portraits so choose screen orientation portraits for this activity because our

82
00:05:32,750 --> 00:05:34,510
application is going to be in portrait.

83
00:05:34,640 --> 00:05:35,490
Right.

84
00:05:35,570 --> 00:05:40,900
So let's go back inside the main activity that are filed here and now we need to add other logic's here.

85
00:05:41,090 --> 00:05:43,530
So now I'm going to paste in a line of code here.

86
00:05:43,730 --> 00:05:46,990
And then I'm going to explain to you what's going on here.

87
00:05:47,270 --> 00:05:51,050
So as you can see here this is the line of code that I pasted here.

88
00:05:51,050 --> 00:05:57,770
So here as you can see we have actually a boolean variable and this is private and this is of type Boolean

89
00:05:58,100 --> 00:06:04,360
and the name of this variable is IIS settings changed and in Ife with an assignment operator here.

90
00:06:04,460 --> 00:06:08,600
And initially I assigned the value of false to this variable.

91
00:06:08,810 --> 00:06:14,030
So this variable is going to determine that there are setting's is actually changed or not.

92
00:06:14,030 --> 00:06:19,220
So for example if I show you this emulator here our application is here and now if I you to go inside

93
00:06:19,220 --> 00:06:24,500
the settings now for example if I change the background color to for example blue.

94
00:06:24,590 --> 00:06:28,520
Now as you can see we actually use this idea.

95
00:06:28,550 --> 00:06:32,260
But in order to determine whether the settings are actually be changed or or not.

96
00:06:32,330 --> 00:06:32,850
Right.

97
00:06:32,930 --> 00:06:34,750
So that's the job of this variable.

98
00:06:34,850 --> 00:06:39,900
And I actually click on this page in here as you can see now that by the background and color of the

99
00:06:39,900 --> 00:06:41,560
Queen's application is blue.

100
00:06:41,570 --> 00:06:42,240
Right.

101
00:06:42,620 --> 00:06:44,590
So hopefully that makes sense.

102
00:06:44,900 --> 00:06:51,470
And now as you can see I'm going to pasting some more lines of code here and then I'm going to explain

103
00:06:51,470 --> 00:06:53,620
to you what's going on here.

104
00:06:53,720 --> 00:06:58,350
So as you can see here these are the lines of code that I pasted here.

105
00:06:58,460 --> 00:07:03,950
So each line number 22 we have actually another variable and this is static.

106
00:07:04,040 --> 00:07:04,420
Right.

107
00:07:04,460 --> 00:07:06,780
So this means that this is going to be A-class valuable.

108
00:07:06,860 --> 00:07:11,030
And we can actually use the class name in order to access this variable.

109
00:07:11,030 --> 00:07:14,460
So for example main activity that Chinawhite.

110
00:07:14,690 --> 00:07:18,150
So as you can see here the data type of this variable is typeface.

111
00:07:18,350 --> 00:07:21,290
Right and the name of this variable is chunk of time.

112
00:07:21,410 --> 00:07:26,930
So as you can see here typeface is used in order to actually hold Fornes in our application.

113
00:07:26,930 --> 00:07:31,240
So as you can see we have some fonts here.

114
00:07:31,250 --> 00:07:35,670
For example chunk 5 Fauntleroy Brown and wonder about wonder about space them all.

115
00:07:35,690 --> 00:07:39,080
So these are the fonts that we actually hold inside our application.

116
00:07:39,080 --> 00:07:44,180
So we actually created these valuables here in order to hold these phones in so that application and

117
00:07:44,420 --> 00:07:47,470
we can access these forums whenever we want to.

118
00:07:47,480 --> 00:07:53,960
So static typeface chunk file so this is the name of this valuable we have and other valuable in line

119
00:07:53,960 --> 00:07:59,120
number 23 static typeface Fauntleroy Brown and line number 24.

120
00:07:59,120 --> 00:08:03,550
We have another variable static typeface wonder about them all right.

121
00:08:03,590 --> 00:08:08,690
So now as you can see here initially we didn't cite any values to these variables.

122
00:08:08,780 --> 00:08:11,160
So let's go inside this uncreate method here.

123
00:08:11,360 --> 00:08:13,980
And now let's get you to initialize these rowdier bells.

124
00:08:14,060 --> 00:08:17,430
So as you can see these are the lines of code that I pasted here.

125
00:08:17,430 --> 00:08:19,550
Inside this uncreate Meffert.

126
00:08:19,760 --> 00:08:25,130
So in line I'm at 45 I am actually initializing this chunk quite variable which is of type typeface.

127
00:08:25,340 --> 00:08:26,390
So chunk 5.

128
00:08:26,390 --> 00:08:32,560
Assignment operator typeface I referred to the name of this class type for start create from a set.

129
00:08:32,660 --> 00:08:38,130
So as you can see here inside our project structure in say the structure of our project now we can see

130
00:08:38,130 --> 00:08:41,700
here inside these assets folder we have this false directory right.

131
00:08:41,720 --> 00:08:44,860
So I said typeface that create from asset.

132
00:08:44,870 --> 00:08:50,870
So here you are referring to these assets directory get assets as you can see here for the first argument

133
00:08:50,900 --> 00:08:56,080
we need to call the Smurfit get assets in order to access this folder come on for the second argument

134
00:08:56,090 --> 00:09:01,120
we need to specify the specific font that we want to access inside these assets folder.

135
00:09:01,130 --> 00:09:05,900
So as you can see here inside the double quotes here we need to provide a string value right.

136
00:09:06,020 --> 00:09:11,410
So instead of double quotes first I referred to the name of this folder false slash.

137
00:09:11,540 --> 00:09:17,810
And now let's actually go inside these phones for their phones slash John 5.40.

138
00:09:17,840 --> 00:09:23,320
So as you can see here we have this phone here Channel Five with capital C that OTTF here.

139
00:09:23,480 --> 00:09:28,530
So here we are accessing this phone and we hear you are initialising this valuable chunk file.

140
00:09:28,940 --> 00:09:32,660
And here we have in line number six fifty six.

141
00:09:32,660 --> 00:09:38,020
We have these Fauntleroy and very well as you can see here I am initialising this variable so Fauntleroy

142
00:09:38,060 --> 00:09:44,000
Brown assignment operator and then I referred again to the name of this class type face that create

143
00:09:44,000 --> 00:09:49,260
from a set first for the first argument we need to specify that we want to access these assets holders

144
00:09:49,280 --> 00:09:55,580
so get assets come up and we need to specify for the second argument the specific format that we want

145
00:09:55,580 --> 00:09:56,300
to access.

146
00:09:56,300 --> 00:10:01,390
So first because we want to access the phones that are inside of this phone strictly the first referred

147
00:10:01,390 --> 00:10:07,260
to the name of the strictly Faunce slash and then I need to refer to the name of this font Fauntleroy

148
00:10:07,310 --> 00:10:14,050
around that PTF as you can see here this faultily Larry Brown is with the capital F and capital B the

149
00:10:14,050 --> 00:10:15,890
same name that we have here.

150
00:10:15,910 --> 00:10:16,300
OK.

151
00:10:16,300 --> 00:10:21,550
This is very important that the name of your font that you specify here for the sake of argument here

152
00:10:21,550 --> 00:10:28,390
for this for the Smurfette create from acid said you need to actually refer to the exact name Fauntleroy

153
00:10:28,420 --> 00:10:29,980
pronounce that PTF.

154
00:10:30,010 --> 00:10:34,370
This is very important and in line number 47 as you can see here.

155
00:10:34,420 --> 00:10:36,870
I am actually initialising this wonder about them.

156
00:10:37,120 --> 00:10:42,980
So wonder about them or assignment operator typeface that creates what I said for the first argument.

157
00:10:42,980 --> 00:10:47,960
Create from a get assets as you can see here here if you are actually accessing these assets folder

158
00:10:48,070 --> 00:10:52,120
and for the second argument we need to specify the specific fonts that you want to access.

159
00:10:52,270 --> 00:10:56,570
So that slash wonder about space them or that atya.

160
00:10:56,590 --> 00:11:01,310
So as you can see here this is the exact name here wonder about space not at here.

161
00:11:01,930 --> 00:11:06,200
So now the initialized are actually phones here already at Bells.

162
00:11:06,580 --> 00:11:12,880
And now we need to actually put some other logic's here inside these uncreate Mefford.

