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

Implementation


This is the most exciting part of this chapter. In a nutshell, our application has a single activity with four fragments. Also, it has a SQLite database with a single table to store marker data.

Defining the app theme

The app theme can be customized by using the styles.xml file in res | values | styles.xml.

The primary color is the color of the action bar. The primary dark color is the color of the status bar. The accent color is the color for FAB. The sample app looks like the following image:

In the preceding screenshot, you can see the usage of primary, primary dark, and accent colors.

The style is defined as:

  <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">#2196F3</item>
        <item name="colorPrimaryDark">#1976D2</item>
        <item name="colorAccent">#FF4081</item>
   </style>

For more material design colors, you can go to http://www.materialpalette.com/.

Defining strings...