WEBVTT

00:00.200 --> 00:08.480
The first step in adding Google Maps to your Android applications is to get the API key.

00:08.840 --> 00:18.880
A Google Maps API key is a unique identifier that authenticates your apps requests to Google's mapping

00:19.000 --> 00:19.960
services.

00:20.160 --> 00:22.480
It ensures authentication.

00:22.480 --> 00:31.160
Google knows who's using their API's, user tracking monitors, requests for billing, if applicable,

00:31.160 --> 00:35.680
and security restricts access to only your app.

00:35.840 --> 00:38.840
Your key can access multiple APIs.

00:39.000 --> 00:49.000
Maps SDK for Android, display images in apps, places API searches for location businesses and directions

00:49.040 --> 00:58.040
API get routes between points, and also you can benefit from the key using the geocoding API that converts

00:58.080 --> 01:00.760
addresses to coordinates and vice versa.

01:00.880 --> 01:07.240
Each may require separate enablement in Google Cloud Console will.

01:07.280 --> 01:13.200
In this video, we're going to enable Android Maps and Google Maps SDK.

01:13.440 --> 01:16.720
And we're going to use it in our project.

01:16.720 --> 01:28.800
Let's move to get and generate our Google Maps API key, open Google Chrome, go to console Cloud.google.com,

01:28.840 --> 01:31.760
log in into your Google account.

01:31.760 --> 01:35.480
I have created the before many projects.

01:35.720 --> 01:37.880
Don't worry, you can get uh.

01:39.000 --> 01:45.920
You are going to create the projects by clicking here and create new project.

01:45.920 --> 01:48.560
Then select the project name.

01:48.560 --> 01:58.720
I'll name it as Google Maps Compose app, then select the location No Organization and click on create.

01:58.760 --> 02:01.280
We succeeded in creating the project.

02:01.280 --> 02:03.160
Click Select project.

02:03.160 --> 02:06.760
Make sure that your project appear here.

02:06.800 --> 02:10.040
Okay, so here we are on our project.

02:10.040 --> 02:12.560
There is a very important thing here.

02:12.560 --> 02:13.680
I should mention.

02:13.680 --> 02:19.480
All APIs require a Google Cloud project with billing enabled.

02:19.480 --> 02:26.600
You will need to generate an API key and restrict it properly, for example by app or referrer.

02:26.760 --> 02:31.320
Some APIs are free up to a quota then billed per use.

02:31.520 --> 02:39.840
So as I told you in the previous video, um, we're not gonna exceed this, this quota and we're not

02:39.880 --> 02:44.760
gonna pay anything just for demonstration, also for basic usages.

02:44.760 --> 02:52.640
And you can share your app across your friends, but, uh, and other users, and you can use it properly.

02:52.640 --> 02:55.680
But there is a certain limit, a certain quota.

02:55.720 --> 02:57.760
We're going to discover it later on.

02:57.960 --> 02:58.480
Okay.

02:58.680 --> 02:59.680
So don't worry.

02:59.880 --> 03:03.560
Just, um, just log in into your account.

03:03.920 --> 03:07.760
Uh, also open the project by using the project picker.

03:08.000 --> 03:13.200
And here we are inside the Google Maps Compose app project.

03:13.200 --> 03:16.130
To get the Google Maps SDK.

03:16.170 --> 03:18.610
We can search for a resource here.

03:18.610 --> 03:20.570
For example maps.

03:20.570 --> 03:23.010
Here we have Google Maps platform.

03:23.010 --> 03:28.210
Also, we can scroll down to get the products embed maps.

03:28.250 --> 03:30.810
Google maps platform, geocoding API.

03:30.850 --> 03:35.330
You can see that this is an API that convert addresses to coordinates.

03:35.610 --> 03:42.370
Also, you can get the places API, find info about places, the direction API, get routes and navigation

03:42.370 --> 03:47.090
info, and embed maps in websites using the maps JavaScript API.

03:47.130 --> 03:52.970
Also, you can discover Google products using the view all products.

03:53.010 --> 03:57.490
Okay, but we are interested in the Google Maps platform.

03:57.490 --> 03:58.410
Click on it.

03:58.450 --> 04:01.690
We need to enable it for our project.

04:01.690 --> 04:04.450
And here we get our API key.

04:04.690 --> 04:14.730
Copy it, don't share it across any of your applications, any of your users friends, or even make

04:14.730 --> 04:15.450
it public.

04:15.690 --> 04:21.330
All you can, uh, restrict it for security, so don't worry.

04:21.370 --> 04:25.210
Copy this API key notepad.

04:25.370 --> 04:29.690
And here we have a new tab and paste it here okay.

04:29.930 --> 04:33.210
Then click go to Google Maps platform.

04:33.210 --> 04:39.890
Select Enable or Google Maps APIs for this project and click go to Maps Platform.

04:39.890 --> 04:47.010
Then we have the new API keys can only be used with Google Maps platform APIs and services.

04:47.010 --> 04:53.210
You should set additional restriction additional restrictions to prevent unexpected usage.

04:53.490 --> 04:55.410
Select Android apps.

04:55.650 --> 04:58.050
Then we have the package name.

04:58.050 --> 04:59.610
This is for security.

04:59.650 --> 05:03.650
We can make it later, but it's very important now.

05:03.890 --> 05:08.730
Restricts API key usage to specified Android apps.

05:08.890 --> 05:16.010
Add package name and a one certificate fingerprint for each app.

05:16.050 --> 05:17.890
This is for security.

05:17.890 --> 05:23.810
So in the next video we're going to learn how to get the one certificate fingerprint.

05:23.810 --> 05:26.530
And we're going to create our project in Android.
