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

Configuring Google Play services


Google Play services include the classes required for our map application. So, it is required to set it up properly. It differs for Eclipse with the ADT plugin and Gradle-based Android Studio. Let's take a look at both separately. It will be simple.

Android Studio

Configuring Google Play services with Android Studio is very simple. You need to add a line of code to your build.gradle file, which contains the Gradle build script required to build our project. There are two build.gradle files. You must add the code to the inner app folder's build.gradle file. The following screenshot shows the structure of the project:

The code should be added to the second Gradle build file that contains our app module's configuration. Add the following code to the dependencies in the Gradle build file:

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

The structure will be similar to the following code:

dependencies {
    compile 'com.google.android.gms:play-services:7.5.0'
 ...