Hire one.
So in this story are you going to take a look at our maps activity that we created in the previous tutorial.
So let's actually double click on the step here that has maps activity there so that this area is actually
voiture and you can see that we have this maps activity class that extends fragment activity and implements
on map ready callback interface.
Right.
And you can see that this instance variable is already created for us private Google map a map.
So map means actually a member variable.
This means member.
So this is actually another name for instance variables.
And here you can see that we have this uncreate method here.
So first it's going to actually call this superadded uncreate method and then it's going to call the
set content if you are totally out of that activity Underland map.
So this is the XML file that is actually generated for us when we created this activity and we have
this support map fragment map fragment get support map fragments managers that find fragments by ID
or ID that map and is going to actually call this map a cinch Meffert on this map fragment here and
it's going to pass the context here which is this.
So these codes are necessary if you want to actually use the maps in Android.
So that's why you see the maps on your emulator.
When we actually land the application into previous tutorials.
So now we can see that we have these interface on the map for the callback interface.
So let's open our Android documentation's And let's see what is this on my pretty callback interface.
So here we can see that this is the android documentation.
So inside the search bar let's search for unmap ready on map ready.
Call interface so let's click on it.
Let's wait a little bit here.
And here it says public interface on my protocol.
Colorizing interface for forwent the map is ready to be used.
OK.
Once an instance of this interface is set on a map fragment or map view object the unmap ready Google
Map method is triggered when the map is ready to be used.
And provides a non-null instance of Google map.
So this actually the interface here is actually going to be called when the map is ready.
Right.
So for example if I show you the emulator you can see that the map is right here right.
And this means that the map is now ready.
And if you go back to I understood you.
So instead this interface we have in effect that must be implemented here and that if it is this one
on map ready.
So when the map is ready and can be actually shown to the user this method is going to be called.
And this means that the codes inside the inside of this movie is going to be executed.
So you can see that first it's going to initialize this map instance variable by passing the Google
Map argument to this area but to this instance variable and it says add a marker in Sydney and move
the camera.
So first it's going to actually specify the latitude and longitude of the specific location that the
map is going to that the map is going to actually show it to the user that specific location.
So by default the location is in Sydney Australia.
So you can see that the latitude is this route and the longitude is this value and it's going to actually
add a marker to that specific location.
So new options that position certainly the total market in Sydney.
So let me show you that the emulator so you can see that this market here is in Sydney.
And if I actually click on this here you can see that it's a market in Sydney.
So this is the title right.
And it has a map to move camera chamcha update's factory that Noul at length Sydney.
So it's going to actually move the camera to this specific location here inside our map if you want
to I can actually change the place of this camera here.
But if you put this code here and map that move camera you are actually calling this live on this map
and it's going to move this camera to this specific location here right Sidney.
So that's on here let us go back to and read documentation.
So now it's as if Google Play services is not installed on the device.
The user will be prompted to install it.
And the unmap ready if it will only be triggered when the user has installed it and returns to the app.
So it says publish if it's somebody on my thready right so called Vandemark is ready to be used.
So you can actually read these documentations here.
So let's go back to our Android studio here.
And here I just wanted to actually give you some explanations about this activity the Smurfs activity
that is actually created here that we just created in the previous tutorials and you can see that these
codes are generated for us automatically.
Right.
You can you can also read these comments here.
It says manipulates the map of what's available.
This callback is triggered and the map is ready to be used.
So you can see that we have also have a description of this on my protocol interface.
This is where we can add markers or lines of listeners or move the camera.
In this case we just add a mulcher near Sydney Australia.
If Google Play services is not installed on the device the user will be prompted to install it and install
Google Play services and return to the map.
So that's it.
And I think that's enough for the situation if you have any questions about the concepts that they touch
in this lesson and please post discussion in of 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 tutorial.