So now let's actually go to our activity and linemen that examined here.
And now let's actually add some more user interface components here.
So now if I show you the other web browser here as you can see here we have the vote to actually get
the value of this child.
Right.
So let's actually create a text view for this child here and now let's go back to our Android studio.
So let me actually get this takes you here and put it here inside this linearly elsewheres the call
and below the spot in here.
Right.
And now for the ID just a pin here to 60 child value and then present interviewee on your keyboard.
And now let's actually drag a button here.
As you can see inside it's widgets folder we have this button.
So just drag it and put it here below this takes view and for the I-T just tape in here between B.T.
and get child value right BT and get child value and that person until you're on your keyboard.
And for the text attributes of this button to step in here get child value and that person Enter key
on your keyboard.
And now let me actually show you their web browser here.
So as you can see here we have this key and we have this value right.
So let's also create another takes and another button for this.
A key value here.
So let's go back to our Android studio.
Inside these widgets folder just selectees takes you here and put it here inside this linearly vertical
and below the Spartan.
And now for the idea just step in here takes the computer takes the computer name and for the text attribute
just typing in here just deletes this right here.
Right.
And this Atlas also selectees takes you here and read the text of this or actually takes you.
And now as you can see if you have this takes you here right.
Takes the computer name.
So let's actually do like a button here.
Inside the switch it's for.
Just select it and put it here inside this linearly or two vertical and below these takes you.
Now for the ID just type in here between jet computer name the computer name and that person into your
keyboard.
And for the text attribute to step in here gets a computer name enter and then.
Here let me show you the web browser as you can see we have also this Keeble you hear more widening.
So let's actually go back to android studio.
Let's actually select this takes here inside this vitiates folder and put it here below this button.
And now for the Id just say in here to the ATX demobilised name and that person into on your keyboard
and deletes that the text attributes as you can see that it does takes here and now let's actually write
about it here.
As you can see in say this with its There's just put it here below this text view.
And for the ID just step in here between get more by learning more by name and then it's actually just
for the text attribute of this button.
Just type in here get more byde name and in person entelechy on your keyboard.
So an analyst actually wrote our project in order to show you actually the face of our application and
now as you can see here this is our emulator.
So we added these to these three buttons get child value get computer names get more by name and we
have also free takes views.
But we can see those values here yet.
So let's actually go back to our main activity the double file here and now inside the uncreate Smurfette.
So before the end in curly brace of this uncreate Smurfit as you can see here now as you can see this
is our uncreate method right.
So before the Indian curly brace of this uncreate Smurfit I can actually declare those objects right.
First of all as you can see inside the emulator we have actually this high value button and we have
also a text view.
So let's actually first of all create the text you so text view the child assignment operator and then
I need to cast this object to actually a text view object find view by ID or that ID that takes the
child as you can see here.
Right.
Takes the child by you and then put a semi-colon at the end at the end of your statement.
And now as you can see we have also the spot in good child value.
So let's create a button here.
So pattern between child assignment operator and then it's actually cestus object to about an object
find view by ID or that ID that Pythian child as you can see here between a child value added with a
semicolon at the end of your statement.
Now as you can see here we have these kids computer name so let's actually first of all create the text.
So it takes few takes the computer name takes the computer name and an assignment operator.
And here it is like let's actually cast this object to our tastes view object find view by ID or that
ID that takes the computer name and then put a semi-colon at the end of your statement.
And here as you can see we have this button right.
Computer Name so button Pythian computer name between a computer and an assignment operator.
And now let's actually cast this object to a button object find view by ID or that Id dot PTEN computer
name and get computer name and then put a semicolon at the end of your statement.
And we have also a text for this by name.
So takes few takes the more widely.
Well when the assignment operator.
And now let's actually test this object to our test view object find the ID r that ID that takes the
more by name and then put a semi-colon at the end of your statement.
And now let's let's actually create an object for this button gets mobiling.
So button between Moabite the assignment operator.
Now let's actually test this object to a button object.
Find your way id or that ID that PTEN more by you get more by name and then put a semicolon at the end
of your statement.
So now let's actually create a listener for the spot in between and child.
So here I can say PTEN child that said unclick listener new view.
So just put a capital V here and then the auto companies feature of Android studio Studio is going to
actually help you to choose this option onco like this and then press an interview on your keyboard.
And now inside is unclear to me.
I can't put my own logic here.
So now first of all I want to actually get sooner let me show you the web browser I want to actually
get the value of this child.
Right.
But as you can see here first of all we have this category Diski.
So first I have to get the reference to the key to this category and then I can actually get a reference
to this child.
And after that I can actually get the value of this choice.
So first we need a reference to this category.
So let's do that here.
So here I can just say for example firebase database thought Get reference.
So now let's actually open our web browser as it kids here.
First we need to get this right.
First we need to get other friends to Diski.
So let's actually copy this key here just like let's click on it and then click on copy.
Let's go back to what I understood you and instead of double quotes just paste that disvalue.
And now we can actually access the child.
So here I can say that child.
And then inside the double quotes as you can see here I can actually put the key which is actually the
child so just highlighted and then right click on it and then just click on.
Copy.
Let's actually go back to and read through and paste this value so now that it actually successfully
accessed the child of this key.
So I put this value to the key here as the child.
And then I can access this by you.
And here I can see that.
And now I need to actually create actually an add value listener here in order to see whether this value
is changed or not.
Or we can actually get the value of that key here and say Dot add value listener.
So first let's actually create a new line here so that you can see these values that add the radio listener.
And here I can see new.
And then just hold the shift key on your keyboard and then present the reader the key on your keyboard.
And now the autocomplete feature of the Android studio is going to help you to choose this option and
that person and until key on your keyboard.
And finally we need to actually put a semicolon after this and prentices.
So insert this update or change method.
We can actually put our own logic here.
Right.
So this is going to be called an effort that you actually change the value of this key.
Right.
So here we can actually get these values because this value is actually a string value as you can see
here instead of double quotes.
We can actually create a single variable.
So I think we can see a string value assignment operator.
So now let me actually just put the right name here.
So string value.
And now I can't say it I can't say data snapshot DOT gets value semicolon.
And inside the parenthesis as you can see here as I said get key.
We can also get the key.
But here we want to actually get the value.
So get value.
And inside the parenthesis because we need to actually specify the data type of the value that we want
to get from the set from the server when inside the prentices we need to specify the data types in that
class.
And here I can say he asks the child that said text value.
So now let's actually run our project and see what happens.
And now let me show you the web browser and let me show you the emulator.
So now as you can see here our application is actually running on this emulator.
So now let's actually click on the Spartan get child value.
And now here as you can see it says value right.
We are getting the value of this child.
So let's actually change this value to another value.
Here we can say my own my own value here and in person in the your keyboard.
As you can see I changed the value of this child and now you can see this value here also my own value
here.
Right.
So if you successfully got this value and now let's actually go back to our Android studio so now let's
actually go inside this uncreate method as you can see here.
This is the end in calibrates of this uncreate method.
Right.
And this is the end in curly brace of this class.
So before the end in curly brace of this uncreate Befort and inside is uncreate perfect.
Let's create a listener for this button as you can see here.
Good computer name.
So now if I actually show you this web browser here as you can see we have computer named Mac Pro.
So I want to actually get this Mac Pro here.
So now let's create a listener so PTEN computer name that sits on click click listener new view that
unclick listener.
And now inside is Uncle Comerford.
I can't say that.
Let's actually create a reference to this computer name.
So here I can say firebase database that gets reference friends.
So instead of double quotes I can't specify the reference.
So the reference is going to be disvalue.
So let's actually copy this value here.
Computer Name.
So right click on it and then click on copy.
And let's actually go to the Android studio and inside the double quotes you can actually paste this
value.
And here we can see that.
And now we don't have a type.
Right.
This value here doesn't have a child.
So we can directly get this value.
So here I can say that at that add value event listener.
And here as you can see I need to put the new key word here and here I can see with capital V as you
can see the autocomplete feature of Android studio is helping me to choose this option value event listener
and then person entelechy on your keyboard.
And now as you can see here the autocomplete feature of Android studio put these lines of code here
for us.
So let me actually put this in another line so that you can see these values are better.
And inside this update or change Mefford I can create a sync rowdier bell.
And as you can see inside this web browser disvalue is instead of double quotes and it is actually an
us think value match.
Right.
So here I can say strange and here the name of my variable could be for example value again.
Assignment operator and here I referred to the name of the state snapshot that actually holds the value
of this key computer name.
So it's a snapshot that gets value.
Semicolon.
And here inside the practice's because this is going to be of type string.
I can say it's strange that class and here I can actually just refer to the name of this takes the more
but takes the computer name.
That's a text value.
OK so now let's run our project and now let me show you the web browser and the emulator.
So let's wait a little bit here.
And I was the case here our application is actually running on the simulator.
So now let's actually click on the spot and get a computer name.
And now as you can see here it says Match which pro.
Right.
So now let's actually change this value match with pro to match.
And that person entered on your keyboard in order to update this value.
And now as you can see here inside the emulator it says matchbook error.
Right.
So hopefully that makes sense.
And now let's actually go back to our Android studio and again inside the curly braces of this uncreate
Smurfette.
So before the Indian curly brace of this country is Meffert we need to actually create our listener
for the spot and this time get more by name.
So here I can say between mobiling that said unclick listener new view unclick new view that Uncle listener.
Now as you can see here we have actually anonymous in a class that is implementing this unclick the
center interface and it is actually providing all an implementation for this uncle Meffert.
So here inside the Anglican if I can put my own logic here.
So now I can say firebase database that gets reference.
So now we need to actually get our reference to discrete as you can see here mobiling.
So let's actually copy disvalue.
So just selected and then right click on it and then click on copy and let's actually go to Android
studio and here inside the parenthesis put two double quotes and inside the double quotes.
Just paste this value my name.
And as you can see we have this word is key here right.
So here I can say that add value events listener knew of value even listener and now as you can see
here you autocomplete feature or Android studio put these lines of code here for me.
So let's actually put this line in a new line as you can see here so that you can see these values here
pedir right.
And we have this undated change method here again.
And now I can actually create a strange variable value assignment operator data snapshot that gives
you an insight Apprentice's I can't say strange that class and then put a semicolon at the end of your
statement.
And here I have said he is the more by name that set text value.
And now let's actually run our project and see what happens.
Let's actually open our Web browser.
And now let me show you the emulator.
So now let me click on the spot and get my name
now as you can see here it says iPhone 7.
So let's actually change this iPhone 7 to iPhone 5 and then person energy on your keyboard.
And now as you can see here it is iPhone 5 here also.
So now we're actually getting these values here easily right.
It is really simple.
We just need to put some lines of code and you can see that it's really fairly simple.
So now what happens if we actually create multiple tiles here.
So for example let's say for example I want to add a child here.
So now I actually need to specify the name.
So here I can say Child 1 or I can say for example something for the name and because I want to create
another child for this child I don't have to actually provide a value for this trial so I just need
to click on this plus button here and here I can say something else right something else and then I'm
able to actually create another child for this child.
And here I can say for example I think.
Right.
And then I want to create another child.
And here I can say for example key and here I can specify the value and then click on it.
So now as you can see here we have a child or something.
And this child also has another child something else and this child hears something else also has an
older child with his which is actually fine.
And this Fink here has another child which is this key that has a value.
So how we can actually get this value right.
So now let's actually go back to our Android studio.
Let's go back to our activity on the line minute segment here and now as you can see I want to actually
get the value of this key right.
So let's actually actually get a text view here from this widgets folder.
Just select it and put it here inside these linear layouts vertical and below the Spartan and for the
idea just step in here.
TIA XTi my value for example takes the my value and then lets actually just write another button here.
So just select this button and put it here.
Below this text view.
And inside is linearly alphabetical.
And here for this Id just type in here between my value and in person.
It helps you on your keyboard and here for the text attribute of the Spartan.
Just type in here for example get my value and that person into a key on your keyboard.
So let's actually go back to our main activity our job right here.
So again let's actually go inside this uncreate method as you can see here at the top it says and creates
Meffert for they actually hover over this and curly brace as you can see it says uncreate Meffert.
So inside this uncreate method it over to actually create those objects first of all we have a takes
takes you right so takes the my value assignment operator and then I need to cast this object to uptakes
view object find your ID are that Id dot he see my value right.
And then I need to put a semicolon at the end of my statement.
And then let's actually create a button so button between my value and then I put an assignment operator
here and then I need to cast this object to our button object.
Find your way Id are that Id dot between BT and my body.
And then put a semicolon at the end of your statement.
So now let's actually create our listener for the spot in between my value that sits on click listener
new view that unclick listener and now inside is Uncle Mefford here I'm going to actually show you something
really important.
So let me open the web browser here.
As you can see here we have something here.
Right.
And inside is something we have something else inside is something else we have this feeling.
And inside these screens we have this key and value.
So how we can access this value.
It's very important as you can see here it is you are in here as you can see I select it right.
This is actually you are at right.
So now let me click on this key here.
As you can see this you are all here changed.
Right.
So now it says this you are in slash something slash something else slash fiend slash key.
So it says that in this instance database instance we have something inside is something we have something
else inside is something else we have this field.
And inside this field we have this key.
So in other words we have actually our reference to this key as you can see it says key value.
So now if we click on this you are in here as you can see this is actually a reference right.
We already have a reference to this database here.
Let me actually just highlighted here so that you can see we already have a reference to this database
but we also want a reference to something and then we want to add a reference to the something else.
And then we want a reference to this field and is key.
So we can add to the capitis value here something slash something else slash slash chie.
So just right click on it and then click on copy.
And now let's actually go back to what Android studio and inside this analyst Meffert I can say firebase
database but get the reference.
So this firebase entire database already actually contains a reference to our instance which is this
one.
But we want a reference to this key right because you want to get the value of this key.
So I want a reference to is key inserted practices of this get reference Smurfette just put two double
quotes and then just paste this value here something.
Slash something else.
Slash slash cheat.
So now let me show you the web browser.
Now that metrically click on this database instance which is actually the name of her application.
And now as you can see I created are you Arel and if you already have access to this instance Salvini
to access this something.
So I put this something here inside the practices and inside double quotes first I put this something
slash and then you want to access something else again something else.
Slash.
And then we want to access this field.
So slash field.
And then we want to access these keys so that we can actually access this value right.
So slash key and here I can say it at value event listener.
Right.
I am actually creating a listener for this key because I can actually access this key so I can actually
create an add value center here so that we can see this value and add value eventless and how new view
the new value event listener and then person into on your keyboard.
So now let me actually create a new line here so that you can see these values here.
As you can see.
So now we need to actually put a semicolon here and now we have this update or change my fifth.
And here I can actually create a single ridable string.
Why do you assignment operator.
And here I can say for example a snapshot start to get value and put a semicolon at the end of your
statement and inside the parenthesis because this is going to be a string value just like in here string
that class.
Right.
And here I can say it takes the mind value that said text value right.
Now let's actually run our project and see what happens.
Now let me show you the web browser and the emulator here.
So now as you can see our application is running on the simulator.
So now let's actually click on the spot and get more value.
And now as you can see here it says value.
So if we successfully accessed the value of this key.
Right.
So I think that's enough for this year.
So if you have any questions about the concepts that are hard to you in this lesson please what's the
discussion in the course and then I do my best to answer all of your questions.
Thank you very much for watching and I'll see you in the next year.
Audiard.