Using Location and Google Maps v2 in Android Apps

8,992 views

Published on

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.

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,992
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
294
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Using Location and Google Maps v2 in Android Apps

  1. 1. Using Google Maps V2 in Android Presented By Joseph Kandi Email: joseph@peruzal.co.za http://www.peruzal.co.za Saturday 14 September 13
  2. 2. Take Aways Create 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
  3. 3. Create A New Project Note: We are using the Google APIs We will need the Package name later Saturday 14 September 13
  4. 4. Blank Activity We want a blank project Saturday 14 September 13
  5. 5. Change Activity Name Change the Activity Name Change the layout xml file name as well Saturday 14 September 13
  6. 6. Download Required APIs Launch SDK Manager Install Google APIs Install Google Repository Install Google Play Services Saturday 14 September 13
  7. 7. Install Required APIs Install Google APIs Install Support Repository Install Google Play Services Install Google Repository Saturday 14 September 13
  8. 8. Add Google Play Services Add the Google Play Services dependency to gradle.build file Gradle configuration file Saturday 14 September 13
  9. 9. 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
  10. 10. Add MapFragment Add the Google Maps Fragment Add fragment Saturday 14 September 13
  11. 11. Declare Options for the MapFragment Add Schema to be able to add map options Add map options Saturday 14 September 13
  12. 12. 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
  13. 13. Get SHA1 Hash with keytool Change directory to the .android folder, its under the Usersuser folder Saturday 14 September 13
  14. 14. Troubleshoot if errors The command might not be in the PATH Saturday 14 September 13
  15. 15. Fix “Command Not Found” Locate the keytool command, it’s installed the in JDK bin folder Saturday 14 September 13
  16. 16. 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
  17. 17. Re-run keytool command keytool command working now Execute command to retrieve the SHA1 fingerprint Saturday 14 September 13
  18. 18. Get SHA1 Hash Copy SHA1 fingerprint Saturday 14 September 13
  19. 19. Complete Setup on Google API Console Paste the fingerprint Saturday 14 September 13
  20. 20. Copy API Key Get the API Key Saturday 14 September 13
  21. 21. Add Required Permissions to AndroidManifest.xml Add the Key to the manifest file Add permissions Require OpenGL ES v2 Saturday 14 September 13
  22. 22. END Shameless marketing : For more on Android Training visit us at http://www.peruzal.co.za Saturday 14 September 13

×