An inside apprentices.
And now let's actually create an if statement here.
If and in say the practices I can't just refer to the name of this TXI the secure random numbers that
get text.
OK.
That is strange.
That land is greater than or equal to number nine here as you can see I am specifying that if the value
of these TXI the secure random numbers if the length of this value is greater than 9 if the characters
if the number of characters of this string value is greater than or equal to number 9 then execute the
lines of code that point to actually to write in say this if statement PTEN secure random number that
said visibility.
OK.
View that invisible.
And here I am specifying that if the length of this value is greater than or equal to number 9 then
it can actually make this are bartend these generate secure random numbers.
In this button.
Invisible OK so that the user cannot see this button anymore.
If the value if the length of this value is greater than or equal to number 9 and the length of this
value means the characters that are actually inside of these text you.
OK.
Now let's actually create a string variable strange and the name of the variable is old takes the secure
random numbers value assignment operator and then I can actually get the value of this text view.
The x is a few random numbers that get text that are two strike.
OK.
As you can see I am actually getting the value of this text view and I am converting that value to us
through value.
And then I am assigning that value to this old to secure and secure random numbers value.
OK so now I can actually typing in random secure number.
OK.
The name of the name of my variable is random secure number assignment operator.
And then I can just refer to the name of this object.
This secure random number object secure random number dot dot next it.
OK.
And it inside the.
I can't just specify a value for example Number 5.
And in this way this method is going to actually generate a random number between these two values.
Number Zero.
And number five.
So this is going to actually generate a random number between number 0 and number five.
OK so now let's actually output this value to large.
So I can just typing like that.
And then inside the apprentice's First of all I need to put him to double quotes and then I can just
type in L or G of the capital letters come on and then I can just refer to the name of this random secure
number avail.
Plus two double quotes because I want to actually convert this value to us string values so that I can
actually output those values to the like.
OK so now let's actually run our project and see what happens.
OK.
As you can see here now are our application is actually running on the emulator.
So if I click on these generate secure random numbers spotting here let's see what happens.
OK as you can see here.
Now this button disappears OK and this value is actually outputted into the lock.
OK.
So first you need to actually use the info from the slug level section here in full.
And then here inside the search bar here you need to actually type in l o g in order to see this value
as you can see here the random number that is generated is number 0.
OK as I said earlier this may fit this secure random number that next.
And 5 is going to actually generate a random number from number 0 to number five.
So it actually so this time it actually the generated number 0 and you may wonder why this button disappeared.
OK so first of all let me point out that inside this unclick method I specified that if the value of
this takes the secure random numbers here this takes you is the length of this text is actually is greater
than number nine or equal to number nine.
Then it's going to actually make this part an invisible this BT and secure random number invisible as
you can see now this button is invisible and we cannot do anything here.
OK.
Because we cannot see that button but we are going actually to solve this problem later a little bit
later but for now I want to actually point out that this method is going to actually generate a random
number between a number 0 to number five.
So what should I do in order to generate a random number between number one and number five.
So in order to solve this problem first I need to actually type in here.
One plus.
So in this way it's going to actually generate a random number between number one and number five.
So let's actually run our project again and see the results.
Ok everyone now as you can see our application is actually running on this emulator here.
And let's actually click on the spot in here generate some huge random numbers as you can see here it
generated this number free here.
OK.
And it's actually solved this problem here.
As you can see now are are actually the button is actually disappeared and we need to actually solve
this problem because the length of this takes view is actually more than nine characters.
So we need to solve this problem.
First of all let's actually create a boolean variable here inside the main activity class at the top
of the file.
So just typing here private boolean first time.
OK.
And then assign the value true to your value.
OK so here are inside these PTEN secure random numbers that Stankovic listener inside the inside the
unclick Mufid.
After this line of code.
Let's actually create inside is unclick my faith.
And here before this line of code here let's actually create an if statement here.
If the value of the first right first time variable is true if the value of this boolean variable is
true OK then it's going to execute these lines of code inside of these curly braces.
TIA the secure random numbers that said text nothing.
OK.
I am assigning this value OK.
This empty value to my art to secure random numbers as you can see this is our text.
OK.
I am saying that if the value of this first time boolean value but is true then it's going to actually
assign the empty value to this text.
We are here.
OK.
And then it's going to actually assign the value falls to this variable.
So let's actually run our project and see the results.
Ok everyone.
Now as you can see our application is actually running on this emulator.
And now if you actually click on this generate secure random numbers let's see what happens.
As you can see here now this value this takes the value of the which is actually gone and this value
this number one is actually here in say that the inside the lock.
OK.
As you can see.
And the problem is solved.
OK but now I want to actually output this value.
This random secure number to the screen.
OK.
So let's actually hope in here TXI the secure random numbers that said text.
OK.
And then in say the prentices I can just type in random number random number.
OK.
And then I need to convert this value to a string value.
So now let's actually run our project and see the results.
OK.
Now as you can see our application is ready.
So let's actually click on this generate secure random numbers as you can see here.
Now the value for is outputted here.
OK.
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
generating a value between a value between number 1 and number five.
OK.
So this.
So the starting value is number one and the ending value is number five.
OK.
You can actually test for free.
OK.
So hopefully that makes sense.