售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
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
Disabling/enabling zoom gestures
Disabling/enabling the street name
Working with click events
Listening to panorama change events
Using custom camera views
Other functions
Orientation to point
Point to orientation
Getting the location
Self-test questions
Summary
9. Google Maps Intents
The need for Google Maps Intents
Defining Intent requests
Action
URI
Package
Display maps
Display maps with a specified zoom level
Searching for a location
Advanced search
Label location
Using navigation
Displaying StreetViewPanorama
Self-test questions
Summary
10. Creating a Custom Map Application
What the custom application does
What additional libraries/classes do we use
Prerequisites
Adding dependencies
Using the material design icons
Adding permissions
Defining the API key and Google Play services version
Implementation
Defining the app theme
Defining strings
Defining and creating a database
Creating layouts
Creating activities and fragments
Summary
A. Answers to Self-test Questions
Chapter 1, Setting Up the Development Environment
Chapter 2, Configuring an API Key and Creating Our First Map Application
Chapter 3, Working with Different Map Types
Chapter 4, Adding Information to Maps
Chapter 5, Interacting with a Map
Chapter 6, Working with Custom Views
Chapter 7, Working with Location Data
Chapter 8, Knowing about the Street View
Chapter 9, Google Maps Intents
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜