Obtenir une clé google maps :
Créer un projet en choisissant une "Google Maps Activity"
Se rendre sur le site https://developers.google.com/maps/documentation/android-api/?hl=fr et cliquer sur "obtenir une clé" puis donner un nom de projet, puis cliquer sur Enable API
Mettre ensuite cette clé dans le fichier google_maps_api.xml de votre projet :
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow this link, follow the directions and press "Create" at the end:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=C0:CF:EA:8A:12:5A:B8:32:E9:4C:68:AC:FF:C3:15:20:50:DE:80:34%3Btb.lussi.testmaps
You can also add your credentials to an existing key, using these values:
Package name:
C0:CF:EA:8A:12:5A:B8:32:E9:4C:68:AC:FF:C3:15:20:50:DE:80:34
SHA-1 certificate fingerprint:
C0:CF:EA:8A:12:5A:B8:32:E9:4C:68:AC:FF:C3:15:20:50:DE:80:34
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false"> LaCléObtenue </string>
</resources>
Niveau de zoom au lancement : à préciser dans activity_maps.xml
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
...
map:cameraZoom="16"
/>