Book Image

Learning Android Google Maps

Book Image

Learning Android Google Maps

Overview of this book

This book helps you to overcome the most common problems faced by users and helps you create a successful map application without any hassle. The book starts with a brief description of how to set up an environment and obtain an API key to create your map application. This book will teach you about adding markers, overlays, and information windows to the map in detail. You will then dive deep into customizing various types of maps and working with location data and Google Street view. By the end of this book, you will be able to create succinct map applications in Android using Google maps efficiently.
Table of Contents (18 chapters)
Learning Android Google Maps
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Prerequisites


We are going to create the project completely with Android Studio. We will start by creating a new project in Android Studio. Here, I have used the package name as packt.mycustommap. You can use the package name of your choice.

You will then have to register your application in the Google Developer Console with the SHA1 fingerprint and package name, and obtain the API key.

Instead of hardcoding the string, it is recommended that we define the string variables in strings.xml in res/values/strings.xml.

Make sure your activity extends to AppCompatActivity.

Adding dependencies

The dependencies should be added to the app's build.gradle file. Our app depends on the Google Play services library and the Android design support library.

Add the following dependencies to build.gradle:

  compile 'com.google.android.gms:play-services:7.5.0'
  compile 'com.android.support:design:22.2.0'

The complete dependencies look similar to the following code:

dependencies {
    compile fileTree(dir: 'libs',...