1
00:00:00,150 --> 00:00:02,190
So hopefully that makes sense.

2
00:00:02,520 --> 00:00:08,820
And as you can see we created these objects here and now we can actually interact with these objects

3
00:00:09,120 --> 00:00:10,360
inside this screen.

4
00:00:10,540 --> 00:00:10,950
OK.

5
00:00:10,990 --> 00:00:11,990
OK everyone.

6
00:00:12,000 --> 00:00:22,730
Now let's actually typing here PTEN result that sets on Cleage listener new view that Uncle listener.

7
00:00:22,740 --> 00:00:23,380
OK.

8
00:00:23,610 --> 00:00:31,620
So as you can see here I made the Spartan to listen to the clique's that the user make on this button.

9
00:00:31,770 --> 00:00:37,590
And then it can actually execute some codes that we actually put inside these curly braces inside the

10
00:00:37,590 --> 00:00:40,040
curly braces of this unplugged Meffert.

11
00:00:40,050 --> 00:00:40,540
OK.

12
00:00:40,620 --> 00:00:48,560
So now I want to actually read the value that the user actually enter inside these textfield here.

13
00:00:48,660 --> 00:00:54,600
And then I were to actually read that value and then when the user click on the spot in here I want

14
00:00:54,600 --> 00:00:58,480
to get that value and then put that value inside these text.

15
00:00:58,490 --> 00:00:59,030
View here.

16
00:00:59,040 --> 00:00:59,680
OK.

17
00:01:00,000 --> 00:01:01,620
So let's see how we can do that.

18
00:01:01,760 --> 00:01:02,340
OK.

19
00:01:02,400 --> 00:01:09,270
Inside this unclear it first actually create a string object and let's actually give a name to this

20
00:01:09,480 --> 00:01:10,400
string object.

21
00:01:10,410 --> 00:01:14,580
For example text field value.

22
00:01:15,240 --> 00:01:22,440
And then I put an assignment operator here and then I actually refer to the name of this text object.

23
00:01:22,440 --> 00:01:22,800
OK.

24
00:01:22,820 --> 00:01:26,020
EDT the number.

25
00:01:26,610 --> 00:01:33,100
Get text dot to strange OK.

26
00:01:33,180 --> 00:01:36,910
If if I actually don't put this to a string Meffert Let's see what happens.

27
00:01:37,330 --> 00:01:39,710
As you can see it's now showing us an error.

28
00:01:39,730 --> 00:01:44,760
So as you can see let's actually hover our mouse pointer over this area and see what happens.

29
00:01:44,830 --> 00:01:53,050
It says incompatible types require Java or to land that string found Android that text that editable.

30
00:01:53,230 --> 00:02:01,240
So as you can see here because you're actually creating a value of type screen we need to assign a value

31
00:02:01,240 --> 00:02:03,520
of string to this value.

32
00:02:03,730 --> 00:02:10,780
But as you can see here this is the number that gettext actually returns a value of type editable.

33
00:02:10,980 --> 00:02:11,490
OK.

34
00:02:11,620 --> 00:02:15,340
And that's not compatible with this string object.

35
00:02:15,340 --> 00:02:22,650
So here there are two ways that we can to actually convert this returned value to a string value.

36
00:02:22,670 --> 00:02:29,460
You can just type in two streams or you can just put an A-plus operator here.

37
00:02:29,680 --> 00:02:31,770
And then you can just put into double quotes.

38
00:02:32,020 --> 00:02:32,450
OK.

39
00:02:32,530 --> 00:02:37,560
And in this way we are actually converting this value to us string value.

40
00:02:37,720 --> 00:02:41,270
And then we are assigning data value to this string object.

41
00:02:41,290 --> 00:02:47,040
OK so here we are actually getting the text that is inside of this.

42
00:02:47,080 --> 00:02:51,440
It is number object located inside of this text field here.

43
00:02:51,600 --> 00:02:58,930
OK remember that we actually gave up an ID to this textfield object as you can see it is the number.

44
00:02:59,170 --> 00:03:05,460
So now I am actually reading the text that is inside of these EDT.

45
00:03:05,530 --> 00:03:06,900
Number object.

46
00:03:07,120 --> 00:03:13,870
And now I want to actually put that right to you or a sign that read you to this directive result object.

47
00:03:13,870 --> 00:03:18,380
So here I can just type in TXI the result that said text.

48
00:03:18,910 --> 00:03:24,420
And then inside Apprentice's I can just revert to the name of this object textfield value.

49
00:03:24,460 --> 00:03:24,930
OK.

50
00:03:25,060 --> 00:03:27,780
Let's actually run our project and see what happens.

51
00:03:27,910 --> 00:03:32,160
So as you can see here now our application is running on this emulator.

52
00:03:32,160 --> 00:03:36,770
Now let's actually enter a number into this text field here.

53
00:03:36,790 --> 00:03:37,380
OK.

54
00:03:37,450 --> 00:03:39,950
So for example number 54.

55
00:03:40,200 --> 00:03:40,730
OK.

56
00:03:40,960 --> 00:03:42,880
So now let's actually click on this.

57
00:03:42,880 --> 00:03:45,960
Show me the result button here as you can see.

58
00:03:46,060 --> 00:03:51,440
Now the text of this text is changed and this value is here 54.

59
00:03:51,730 --> 00:03:52,450
OK.

60
00:03:52,810 --> 00:03:56,610
So another important point that I want to actually show you is that.

61
00:03:56,710 --> 00:04:03,190
So as you can see here this uncreate me if it actually is called when ever that we actually run our

62
00:04:03,190 --> 00:04:03,960
application.

63
00:04:03,970 --> 00:04:10,150
So when our application is actually started this method is going to be called and the codes inside of

64
00:04:10,150 --> 00:04:12,970
this method is going to be called once only once.

65
00:04:12,970 --> 00:04:13,710
OK.

66
00:04:13,960 --> 00:04:19,870
So as you can see here I've created some objects from this text view class from this area text class

67
00:04:20,230 --> 00:04:22,090
and from disputant class.

68
00:04:22,090 --> 00:04:28,480
And as you can see here the Android studio Id actually put this final cheap keyboard before these two

69
00:04:28,480 --> 00:04:30,450
objects automatically for us.

70
00:04:30,490 --> 00:04:37,720
So and that means these objects is going to be constant and we cannot actually change the value of these

71
00:04:37,720 --> 00:04:38,640
constants.

72
00:04:38,740 --> 00:04:41,050
Once we assign a value to these constants.

73
00:04:41,050 --> 00:04:41,640
OK.

74
00:04:41,770 --> 00:04:50,140
So here as you can see I actually assigned the value of this text the value the value of these textfield

75
00:04:50,140 --> 00:04:53,600
value object to this takes the result object here.

76
00:04:53,620 --> 00:04:54,150
OK.

77
00:04:54,280 --> 00:05:01,510
And I cannot actually refer to another value or to another object and then assign that why do you treat

78
00:05:01,520 --> 00:05:02,100
this object.

79
00:05:02,120 --> 00:05:10,770
Or you can only access the value of this object and the value of this object is the value of the EDT

80
00:05:10,790 --> 00:05:12,310
number textfield here.

81
00:05:12,310 --> 00:05:12,780
OK.

82
00:05:12,890 --> 00:05:20,290
So whenever we actually putting a text inside these textfield here that value is going to be assigned

83
00:05:20,290 --> 00:05:22,240
to these T it's the result here.

84
00:05:22,240 --> 00:05:22,750
OK.

85
00:05:22,900 --> 00:05:28,130
So here I can actually delete this number and I can actually assign an order value.

86
00:05:28,490 --> 00:05:32,880
And if I actually click on the spot in here as you can see this value is changed.

87
00:05:32,920 --> 00:05:33,320
OK.

88
00:05:33,430 --> 00:05:37,540
Because you are actually reading from this textfield object.

89
00:05:37,540 --> 00:05:41,810
This takes real object is an object of type string.

90
00:05:42,100 --> 00:05:50,170
And here you are actually assigning the value of that is inside of these textfield object a key number

91
00:05:50,410 --> 00:05:51,670
that get fixed.

92
00:05:51,820 --> 00:05:57,250
And here you are actually converting this value to a string value in order to assign this value to these

93
00:05:57,990 --> 00:05:59,980
textfield value object.

94
00:05:59,980 --> 00:06:00,660
OK.

95
00:06:00,880 --> 00:06:02,580
So hopefully that makes sense.

96
00:06:02,650 --> 00:06:10,090
And now I want to actually use the if statement here in order to show you how to use this control statement

97
00:06:10,110 --> 00:06:10,610
in.

98
00:06:10,810 --> 00:06:12,550
In our Android applications.

99
00:06:12,550 --> 00:06:13,210
OK.

100
00:06:13,660 --> 00:06:22,420
So now I can actually typing in here if and now inside Apprentice's I can just put up an expression

101
00:06:22,420 --> 00:06:26,200
here that's actual results in a true or false value.

102
00:06:26,200 --> 00:06:29,230
We can only put a value of type.

103
00:06:29,230 --> 00:06:35,050
True or false or and that results in a true or false value.

104
00:06:35,050 --> 00:06:36,250
So let me show you that.

105
00:06:36,460 --> 00:06:43,990
So here for example I want to specify that when ever that a user putting a number 51 into this or textfield

106
00:06:43,990 --> 00:06:49,400
here I want to actually put in another text beside that result.

107
00:06:49,480 --> 00:06:59,470
So let me show you that for example a text if text field value that contains and that inside the apprentice's

108
00:06:59,500 --> 00:07:05,860
I can just put in the wall 51 here and then I need to actually open and close my statement by using

109
00:07:05,860 --> 00:07:07,200
these curly braces.

110
00:07:07,210 --> 00:07:11,130
So now let me actually cut this line of code here.

111
00:07:11,200 --> 00:07:13,070
And let's actually put this line of code here.

112
00:07:13,270 --> 00:07:17,710
And now I can actually concatenate this value with another value for example.

113
00:07:17,710 --> 00:07:18,200
Great.

114
00:07:18,250 --> 00:07:18,880
OK.

115
00:07:18,940 --> 00:07:22,000
So let's actually run our project and see what happens.

116
00:07:22,000 --> 00:07:22,900
OK everyone.

117
00:07:22,900 --> 00:07:26,110
Now as you can see here I need to actually enter a value here.

118
00:07:26,110 --> 00:07:26,620
OK.

119
00:07:26,830 --> 00:07:31,230
So for example I can actually put in a number here for example number 50.

120
00:07:31,450 --> 00:07:32,080
OK.

121
00:07:32,080 --> 00:07:36,640
So if I actually click on this button here let's see what happens.

122
00:07:36,640 --> 00:07:39,150
So as you can see here nothing happened.

123
00:07:39,280 --> 00:07:39,730
OK.

124
00:07:39,850 --> 00:07:41,350
So what's going on here.

125
00:07:41,350 --> 00:07:47,620
So as you can see here inside this unclick Smurfette as you can see we are actually getting the value

126
00:07:47,620 --> 00:07:49,320
of these EDT.

127
00:07:49,360 --> 00:07:53,440
Number textfield here OK the value of this text here.

128
00:07:53,500 --> 00:07:53,950
OK.

129
00:07:54,010 --> 00:07:57,790
And we are actually assigning that value to this string object.

130
00:07:57,790 --> 00:07:58,170
OK.

131
00:07:58,180 --> 00:08:00,030
Textfield value.

132
00:08:00,070 --> 00:08:06,880
And here we are actually creating actually an if statement in order to actually specify that if only

133
00:08:06,880 --> 00:08:11,480
the value of these are textfield is 51.

134
00:08:11,650 --> 00:08:14,270
It's going to actually execute this line of code here.

135
00:08:14,410 --> 00:08:21,900
But if the value of these textfield value as you can see the value that is inside of these attacks will

136
00:08:21,910 --> 00:08:24,010
here is not 51.

137
00:08:24,130 --> 00:08:31,510
It is not going to execute any line of code here because we didn't specify that when the value of this

138
00:08:31,510 --> 00:08:33,640
textfield is not 51.

139
00:08:33,760 --> 00:08:34,870
So what should be done.

140
00:08:34,870 --> 00:08:43,120
So now I can actually putting in an else statement here and now I actually opened and close this statement

141
00:08:43,120 --> 00:08:48,530
here by using these curly braces I can actually put in another line of code so I can just type anti-X

142
00:08:48,550 --> 00:08:52,260
the result that said text.

143
00:08:52,900 --> 00:08:59,140
And then inside Apprentice's I can just put in two double quotes here and I can just typing in the value

144
00:09:00,880 --> 00:09:04,380
is not 51.

145
00:09:04,750 --> 00:09:05,540
OK.

146
00:09:06,070 --> 00:09:11,800
And the value is.

147
00:09:12,210 --> 00:09:18,090
And then I can actually concatenate this value with the value of these textfield value OK.

148
00:09:18,100 --> 00:09:20,530
So I can just type in here it takes me or do I do.

149
00:09:20,770 --> 00:09:27,130
So now as you can see for example if we actually change this number to number 51 and if I actually click

150
00:09:27,160 --> 00:09:27,490
on this.

151
00:09:27,490 --> 00:09:28,770
Show me the results button here.

152
00:09:28,780 --> 00:09:30,960
As you can see it says 51.

153
00:09:30,970 --> 00:09:31,390
Great.

154
00:09:31,420 --> 00:09:31,870
OK.

155
00:09:31,870 --> 00:09:35,100
So it did actually execute this line of code here.

156
00:09:35,170 --> 00:09:35,410
OK.

157
00:09:35,410 --> 00:09:41,320
Inside of these statements because these textfield actually contains this value 51.

158
00:09:41,500 --> 00:09:45,970
OK so now let's actually run our project again and let's see what happens.

