using location and google maps v2 in android apps
DESCRIPTION
The slides were presented as part of the Cape Town Android App Development training on how to use the Google Maps v2 in Android Apps with Android Studio.TRANSCRIPT
![Page 1: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/1.jpg)
Using Google Maps V2 in Android
Presented By Joseph KandiEmail: [email protected]://www.peruzal.co.za
Saturday 14 September 13
![Page 2: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/2.jpg)
Take AwaysCreate A New Project in Android Studio
Use SDK Manager to Download Required APIs
Add Google Play Services to Project
Add the MapFragment
Get the Android API Key
Add Required Permissions to AndroidManifest.xml file
Manipulate the Map Programmatically
Add Markers to the Map
Saturday 14 September 13
![Page 3: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/3.jpg)
Create A New Project
Note: We are using the Google APIs
We will need the Package name later
Saturday 14 September 13
![Page 4: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/4.jpg)
Blank Activity
We want a blank project
Saturday 14 September 13
![Page 5: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/5.jpg)
Change Activity Name
Change the Activity Name
Change the layout xml file name as well
Saturday 14 September 13
![Page 6: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/6.jpg)
Download Required APIs
Launch SDK Manager
Install Google APIs
Install Google Repository
Install Google Play Services
Saturday 14 September 13
![Page 7: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/7.jpg)
Install Required APIs
Install Google APIs
Install Support Repository
Install Google Play Services
Install Google Repository
Saturday 14 September 13
![Page 8: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/8.jpg)
Add Google Play Services
Add the Google Play Services dependency to gradle.build file
Gradle configuration file
Saturday 14 September 13
![Page 9: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/9.jpg)
Getting the API Key
Sign Up on Google API Console
Create a New Project
Enable Google Android Maps V2
Use the keytool to get the SHA1 signing keys
Get the API key from Google API Console
Saturday 14 September 13
![Page 10: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/10.jpg)
Add MapFragment
Add the Google Maps Fragment
Add fragment
Saturday 14 September 13
![Page 11: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/11.jpg)
Declare Options for the MapFragment
Add Schema to be able to add map options
Add map options
Saturday 14 September 13
![Page 12: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/12.jpg)
Create New Android Key
Create a new Android key
Enable Google Maps Android V2 under Services
Paste SHA1 key fingerprint here, follow the example below
Saturday 14 September 13
![Page 13: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/13.jpg)
Get SHA1 Hash with keytool
Change directory to the .android folder, its under the Users\user folder
Saturday 14 September 13
![Page 14: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/14.jpg)
Troubleshoot if errors
The command might not be in the PATH
Saturday 14 September 13
![Page 15: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/15.jpg)
Fix “Command Not Found”
Locate the keytool command, it’s installed the in JDK bin folder
Saturday 14 September 13
![Page 16: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/16.jpg)
Modify PATH environment variable
Edit the PATH environment variable and add the the location to the JDK bin folder
Choose PATH
Choose Edit
Saturday 14 September 13
![Page 17: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/17.jpg)
Re-run keytool commandkeytool command working now
Execute command to retrieve the SHA1 fingerprint
Saturday 14 September 13
![Page 18: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/18.jpg)
Get SHA1 Hash
Copy SHA1 fingerprint
Saturday 14 September 13
![Page 19: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/19.jpg)
Complete Setup on Google API Console
Paste the fingerprint
Saturday 14 September 13
![Page 20: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/20.jpg)
Copy API Key
Get the API Key
Saturday 14 September 13
![Page 21: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/21.jpg)
Add Required Permissions to AndroidManifest.xml
Add the Key to the manifest file
Add permissionsRequire OpenGL ES v2
Saturday 14 September 13
![Page 22: Using Location and Google Maps v2 in Android Apps](https://reader033.vdocuments.mx/reader033/viewer/2022042512/555ac6e6d8b42ab1128b50ec/html5/thumbnails/22.jpg)
ENDShameless marketing : For more on Android Training
visit us at
http://www.peruzal.co.za
Saturday 14 September 13