1
00:00:00,630 --> 00:00:02,240
An inside apprentices.

2
00:00:02,280 --> 00:00:05,930
And now let's actually create an if statement here.

3
00:00:06,160 --> 00:00:13,440
If and in say the practices I can't just refer to the name of this TXI the secure random numbers that

4
00:00:13,620 --> 00:00:14,470
get text.

5
00:00:14,490 --> 00:00:14,970
OK.

6
00:00:15,050 --> 00:00:16,760
That is strange.

7
00:00:16,950 --> 00:00:27,000
That land is greater than or equal to number nine here as you can see I am specifying that if the value

8
00:00:27,000 --> 00:00:34,890
of these TXI the secure random numbers if the length of this value is greater than 9 if the characters

9
00:00:34,920 --> 00:00:43,710
if the number of characters of this string value is greater than or equal to number 9 then execute the

10
00:00:43,710 --> 00:00:52,620
lines of code that point to actually to write in say this if statement PTEN secure random number that

11
00:00:52,920 --> 00:00:55,100
said visibility.

12
00:00:56,080 --> 00:00:56,670
OK.

13
00:00:56,730 --> 00:01:00,590
View that invisible.

14
00:01:00,630 --> 00:01:08,510
And here I am specifying that if the length of this value is greater than or equal to number 9 then

15
00:01:08,510 --> 00:01:15,790
it can actually make this are bartend these generate secure random numbers.

16
00:01:15,860 --> 00:01:16,870
In this button.

17
00:01:16,980 --> 00:01:21,220
Invisible OK so that the user cannot see this button anymore.

18
00:01:21,330 --> 00:01:28,290
If the value if the length of this value is greater than or equal to number 9 and the length of this

19
00:01:28,290 --> 00:01:33,190
value means the characters that are actually inside of these text you.

20
00:01:33,350 --> 00:01:33,840
OK.

21
00:01:33,890 --> 00:01:34,190
OK.

22
00:01:34,190 --> 00:01:42,360
Now let's actually create a string variable strange and the name of the variable is old takes the secure

23
00:01:43,440 --> 00:01:52,970
random numbers value assignment operator and then I can actually get the value of this text view.

24
00:01:53,240 --> 00:01:58,950
The x is a few random numbers that get text that are two strike.

25
00:01:59,340 --> 00:02:00,010
OK.

26
00:02:00,030 --> 00:02:06,150
As you can see I am actually getting the value of this text view and I am converting that value to us

27
00:02:06,150 --> 00:02:07,200
through value.

28
00:02:07,410 --> 00:02:13,610
And then I am assigning that value to this old to secure and secure random numbers value.

29
00:02:13,630 --> 00:02:22,230
OK so now I can actually typing in random secure number.

30
00:02:22,740 --> 00:02:23,430
OK.

31
00:02:23,600 --> 00:02:30,050
The name of the name of my variable is random secure number assignment operator.

32
00:02:30,350 --> 00:02:33,690
And then I can just refer to the name of this object.

33
00:02:33,710 --> 00:02:42,720
This secure random number object secure random number dot dot next it.

34
00:02:43,400 --> 00:02:43,820
OK.

35
00:02:43,970 --> 00:02:45,260
And it inside the.

36
00:02:45,320 --> 00:02:49,260
I can't just specify a value for example Number 5.

37
00:02:49,640 --> 00:02:54,710
And in this way this method is going to actually generate a random number between these two values.

38
00:02:54,710 --> 00:02:55,390
Number Zero.

39
00:02:55,390 --> 00:02:56,690
And number five.

40
00:02:56,690 --> 00:03:02,550
So this is going to actually generate a random number between number 0 and number five.

41
00:03:02,780 --> 00:03:08,900
OK so now let's actually output this value to large.

42
00:03:09,020 --> 00:03:13,490
So I can just typing like that.

43
00:03:14,030 --> 00:03:19,550
And then inside the apprentice's First of all I need to put him to double quotes and then I can just

44
00:03:19,550 --> 00:03:27,800
type in L or G of the capital letters come on and then I can just refer to the name of this random secure

45
00:03:27,860 --> 00:03:29,370
number avail.

46
00:03:29,840 --> 00:03:35,510
Plus two double quotes because I want to actually convert this value to us string values so that I can

47
00:03:35,510 --> 00:03:37,840
actually output those values to the like.

48
00:03:37,850 --> 00:03:42,240
OK so now let's actually run our project and see what happens.

49
00:03:42,460 --> 00:03:43,010
OK.

50
00:03:43,130 --> 00:03:48,340
As you can see here now are our application is actually running on the emulator.

51
00:03:48,380 --> 00:03:53,910
So if I click on these generate secure random numbers spotting here let's see what happens.

52
00:03:54,080 --> 00:03:55,210
OK as you can see here.

53
00:03:55,210 --> 00:04:01,380
Now this button disappears OK and this value is actually outputted into the lock.

54
00:04:01,460 --> 00:04:02,130
OK.

55
00:04:02,360 --> 00:04:08,200
So first you need to actually use the info from the slug level section here in full.

56
00:04:08,390 --> 00:04:15,230
And then here inside the search bar here you need to actually type in l o g in order to see this value

57
00:04:15,530 --> 00:04:19,770
as you can see here the random number that is generated is number 0.

58
00:04:20,050 --> 00:04:24,470
OK as I said earlier this may fit this secure random number that next.

59
00:04:24,470 --> 00:04:30,630
And 5 is going to actually generate a random number from number 0 to number five.

60
00:04:30,650 --> 00:04:36,440
So it actually so this time it actually the generated number 0 and you may wonder why this button disappeared.

61
00:04:36,440 --> 00:04:44,090
OK so first of all let me point out that inside this unclick method I specified that if the value of

62
00:04:44,090 --> 00:04:50,750
this takes the secure random numbers here this takes you is the length of this text is actually is greater

63
00:04:50,750 --> 00:04:53,260
than number nine or equal to number nine.

64
00:04:53,480 --> 00:05:00,860
Then it's going to actually make this part an invisible this BT and secure random number invisible as

65
00:05:00,860 --> 00:05:05,560
you can see now this button is invisible and we cannot do anything here.

66
00:05:05,600 --> 00:05:05,830
OK.

67
00:05:05,840 --> 00:05:10,370
Because we cannot see that button but we are going actually to solve this problem later a little bit

68
00:05:10,370 --> 00:05:18,110
later but for now I want to actually point out that this method is going to actually generate a random

69
00:05:18,110 --> 00:05:21,020
number between a number 0 to number five.

70
00:05:21,020 --> 00:05:29,390
So what should I do in order to generate a random number between number one and number five.

71
00:05:29,480 --> 00:05:33,390
So in order to solve this problem first I need to actually type in here.

72
00:05:33,650 --> 00:05:36,300
One plus.

73
00:05:36,380 --> 00:05:44,840
So in this way it's going to actually generate a random number between number one and number five.

74
00:05:44,840 --> 00:05:48,490
So let's actually run our project again and see the results.

75
00:05:48,530 --> 00:05:54,010
Ok everyone now as you can see our application is actually running on this emulator here.

76
00:05:54,050 --> 00:06:01,040
And let's actually click on the spot in here generate some huge random numbers as you can see here it

77
00:06:01,040 --> 00:06:03,200
generated this number free here.

78
00:06:03,440 --> 00:06:04,430
OK.

79
00:06:04,970 --> 00:06:08,590
And it's actually solved this problem here.

80
00:06:08,750 --> 00:06:13,820
As you can see now are are actually the button is actually disappeared and we need to actually solve

81
00:06:13,820 --> 00:06:21,550
this problem because the length of this takes view is actually more than nine characters.

82
00:06:21,890 --> 00:06:23,590
So we need to solve this problem.

83
00:06:23,810 --> 00:06:31,040
First of all let's actually create a boolean variable here inside the main activity class at the top

84
00:06:31,040 --> 00:06:32,190
of the file.

85
00:06:32,750 --> 00:06:39,420
So just typing here private boolean first time.

86
00:06:40,170 --> 00:06:40,800
OK.

87
00:06:40,820 --> 00:06:43,840
And then assign the value true to your value.

88
00:06:43,910 --> 00:06:52,670
OK so here are inside these PTEN secure random numbers that Stankovic listener inside the inside the

89
00:06:52,670 --> 00:06:53,760
unclick Mufid.

90
00:06:53,960 --> 00:06:55,910
After this line of code.

91
00:06:56,010 --> 00:06:59,080
Let's actually create inside is unclick my faith.

92
00:06:59,270 --> 00:07:03,950
And here before this line of code here let's actually create an if statement here.

93
00:07:03,950 --> 00:07:13,730
If the value of the first right first time variable is true if the value of this boolean variable is

94
00:07:13,730 --> 00:07:20,220
true OK then it's going to execute these lines of code inside of these curly braces.

95
00:07:20,230 --> 00:07:28,600
TIA the secure random numbers that said text nothing.

96
00:07:28,860 --> 00:07:29,480
OK.

97
00:07:29,830 --> 00:07:32,700
I am assigning this value OK.

98
00:07:32,730 --> 00:07:39,240
This empty value to my art to secure random numbers as you can see this is our text.

99
00:07:39,310 --> 00:07:40,040
OK.

100
00:07:40,420 --> 00:07:46,560
I am saying that if the value of this first time boolean value but is true then it's going to actually

101
00:07:47,000 --> 00:07:49,740
assign the empty value to this text.

102
00:07:49,760 --> 00:07:50,300
We are here.

103
00:07:50,320 --> 00:07:50,940
OK.

104
00:07:51,190 --> 00:07:56,740
And then it's going to actually assign the value falls to this variable.

105
00:07:56,740 --> 00:07:59,890
So let's actually run our project and see the results.

106
00:07:59,980 --> 00:08:00,630
Ok everyone.

107
00:08:00,640 --> 00:08:05,040
Now as you can see our application is actually running on this emulator.

108
00:08:05,140 --> 00:08:11,680
And now if you actually click on this generate secure random numbers let's see what happens.

109
00:08:11,890 --> 00:08:20,450
As you can see here now this value this takes the value of the which is actually gone and this value

110
00:08:20,500 --> 00:08:24,280
this number one is actually here in say that the inside the lock.

111
00:08:24,550 --> 00:08:24,790
OK.

112
00:08:24,850 --> 00:08:26,290
As you can see.

113
00:08:26,650 --> 00:08:28,860
And the problem is solved.

114
00:08:29,150 --> 00:08:33,640
OK but now I want to actually output this value.

115
00:08:33,650 --> 00:08:36,940
This random secure number to the screen.

116
00:08:37,150 --> 00:08:37,740
OK.

117
00:08:37,990 --> 00:08:47,030
So let's actually hope in here TXI the secure random numbers that said text.

118
00:08:47,050 --> 00:08:47,710
OK.

119
00:08:47,980 --> 00:08:54,380
And then in say the prentices I can just type in random number random number.

120
00:08:54,660 --> 00:08:54,960
OK.

121
00:08:54,970 --> 00:08:59,420
And then I need to convert this value to a string value.

122
00:08:59,440 --> 00:09:02,390
So now let's actually run our project and see the results.

123
00:09:02,470 --> 00:09:03,030
OK.

124
00:09:03,190 --> 00:09:06,600
Now as you can see our application is ready.

125
00:09:06,610 --> 00:09:13,240
So let's actually click on this generate secure random numbers as you can see here.

126
00:09:13,270 --> 00:09:16,290
Now the value for is outputted here.

127
00:09:16,360 --> 00:09:16,960
OK.

128
00:09:17,200 --> 00:09:29,230
So let's actually click on this button here again 2 4 1 4 2 2 free as you can see here it is actually

129
00:09:29,230 --> 00:09:35,670
generating a value between a value between number 1 and number five.

130
00:09:35,970 --> 00:09:36,650
OK.

131
00:09:36,910 --> 00:09:37,360
So this.

132
00:09:37,360 --> 00:09:41,740
So the starting value is number one and the ending value is number five.

133
00:09:41,980 --> 00:09:42,960
OK.

134
00:09:43,250 --> 00:09:47,090
You can actually test for free.

135
00:09:47,410 --> 00:09:48,100
OK.

136
00:09:48,430 --> 00:09:49,820
So hopefully that makes sense.

