Learning Android Google Maps
eBook - ePub

Learning Android Google Maps

  1. 356 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Android Google Maps

About this book

Integrate Google Maps with your Android application to offer feature-rich and interactive maps

About This Book

  • Set up the development environment and obtain the Google API key to create your first map application
  • Create a cutting edge Google maps application by implementing all the concepts learned
  • A step-by-step tutorial guide that is full of pragmatic examples

Who This Book Is For

If you are an Android developer and want to integrate maps into your application, then this book is definitely for you. This book is intended for novice Android application developers who would like to get up and running with map rich applications using Google Maps. Some basic development experience would be helpful but it's not a mandate.

What You Will Learn

  • Get to know about the basic development environment setup needed to create a successful map application
  • Generate an SHA1 fingerprint, obtain an API key, and create a basic map application
  • Detect different types of maps and implement them in your application
  • Add information to your map such as markers, overlays, information windows, and shapes
  • Explore the interaction with maps and work with gestures
  • Change the different camera views in your map application
  • Work with real-time GPS location data and implementing it in your application
  • Apply Street View and integrate the StreetViewPanoroma fragment to your application
  • Employ the native Google maps application to solve some of the tasks using intents
  • Create a cutting edge Google maps application by implementing all the concepts learned

In Detail

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.

Style and approach

The book is tailored for the reader with a fundamental approach to Android Google Maps providing a step-by-step introduction to Android Google Maps. It focuses on simple, easy-to-understand examples that are pragmatic and serve as useful basis for real-world applications. Different topics are approached in a bottom-up fashion, gradually going from the simplest foundations to the most advanced features.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Learning Android Google Maps


Table of Contents

Learning Android Google Maps
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Setting Up the Development Environment
The importance of Android Google Maps
An example of a map application
IDEs for developing Android applications
Android Studio
System requirements for Android Studio
Eclipse
Choosing one IDE over another
Setting up Android Studio
Windows
Mac OS X
Linux
Setting up Eclipse with the ADT plugin
Windows
Mac OS X
Linux
Downloading and setting up Google Play services
Downloading the Google APIs System Image
Setting up AVD for testing
Setting up AVD from Android Studio
Setting up AVD from Eclipse
Exploring Android Studio
Creating a sample application
Exporting the Android application as APK
Additional helpful stuff
Using Android Debug Bridge
Configuring JAVA environment variables
Android API levels
Self-test questions
Summary
2. Configuring an API Key and Creating Our First Map Application
Generating the SHA1 fingerprint
Windows
Linux
Mac OS X
Registering in the Google Developer Console
Configuring Google Play services
Android Studio
Eclipse
Adding permissions and defining the API key
Adding permissions
INTERNET
ACCESS_NETWORK_STATE
WRITE_EXTERNAL_STORAGE
READ_GSERVICES
Specifying the Google Play services version
Specifying the version 2 of OpenGL ES
Defining the API key
Creating our first map application
Working with a layout
Optional (for old APIs)
Working with the Activity class
Optional (for old APIs)
Adding MapFragment programatically
activity_maps.xml – code 3
Optional – for older APIs
Using the callback method
The GoogleMap object
Common problems and solutions
Self-test questions
Summary
3. Working with Different Map Types
The need for different types of maps
Delving into different types of maps and their differences
Normal map
Satellite map
Hybrid map
Terrain map
Implementing different types of maps
Using a normal map
Using a satellite map
Using a hybrid map
Using a terrain map
What if I don't need anything?
Working with indoor maps
Using the lite mode
Map types and constants
Self-test questions
Summary
4. Adding Information to Maps
Importance of adding information to a map
Adding information with markers
How to add a marker?
Customizing the marker
Changing the marker color
Changing the marker opacity
Using a custom image as a marker
Flattening a marker
Rotating a marker
Hiding a marker
Employing marker events
Marker click events
Marker drag events
Expanding markers with information windows
How to add an information window?
Showing/hiding an information window programmatically
Creating custom information windows
Working with shapes
Polyline
Creating a polyline
Polygons
Creating a polygon
Creating a hollow polygon
Circles
Creating a circle
Customizing the appearance of shapes
Changing the stroke color
Using a fill color
Changing the stroke width
Geodesic segments
Z-Index
Changing the visibility
Using overlays
Ground overlays
Adding a ground overlay
Positioning a ground overlay
Tile overlays
Tile coordinates and zoom levels
Removing a tile overlay
Clearing the cache
Self-test questions
Summary
5. Interacting with a Map
Need for interaction with a map
Working with UI controls
Zoom controls
Compass
The My Location button
Level picker
Custom applications
Working with the map toolbar
Working with gestures
Zoom gestures
Double tap
Two finger tap
Two finger pinch/stretch (pinch to zoom)
One finger zoom
Scroll gestures
Tilt gestures
Rotate gestures
Disabling/Enabling UI controls and gestures with XML attributes
Disabling/enabling the UI controls and gestures with the GoogleMapOptions object
Working with map events
Map click/long click events
Camera change events
Indoor map events
Using a Projection class
Creating a custom application
Self-test questions
Summary
6. Working with Custom Views
The need for different camera views
Working with camera positions
Target
Zoom
Bearing
Tilt
Moving the camera
Changing the zoom level in the current position
Changing the camera position
Using the CameraPosition class
Setting boundaries
Panning the map
Animating the camera
Map padding
Self-test questions
Summary
7. Working with Location Data
The need for location data
Prerequisites
ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION
Using the my location layer
Using the Android Location API
Using the Google Play services Location API
Working with the Android Location API
Working with the Google Play services Location API
Getting the last known location
Location updates
Using reverse geocoding
Working with Geofences
Integrating location data with maps
Self-test questions
Summary
8. Know about the Street View
About Google Street View
Prerequisites
Implementing StreetViewPanoramaFragment
Adding StreetViewPanoramaFragment programmatically
Customizing StreetViewPanorama
Disabling/enabling pan gestures
Disabling/enabling user navigation
Disablin...

Table of contents

  1. Learning Android Google Maps

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Learning Android Google Maps by Raj Amal W. in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Java. We have over one million books available in our catalogue for you to explore.