No images? Click here Add location, contextual awareness, and mapping to your Android appOne of the defining features of mobile devices is their portability, so it’s not surprising that some of the most enticing APIs are those that enable you to find, contextualize, and map the user’s physical location, environment, and context. In Chapter 15 of Professional Android, Fourth Edition, Reto Meier and Ian Lake show you how to add location, contextual awareness, and mapping to your Android app. It's packed full of practical examples, and you'll learn how to install and use Google Play services to take advantage of these powerful and efficient APIs. Location Services enable you to find the device’s current location, and get updates as it changes. You’ll learn how to use the Fused Location Provider to take advantage of underlying GPS-, cell-, or Wi-Fi-based location-sensing technologies. You’ll also learn about the legacy platformlocation-based services and how to use them when Google Play services aren’t available. Using the Google Maps API, also included as part of the Google Play services library, you can create map-based Activities using Google Maps as a user interface element. You have full access to the map, which enables you to control the camera position, alter the zoom level, and annotate maps using markers, shapes, and image overlays—as well as handling user interactions. Maps and location-based services use latitude and longitude to pinpoint geographic locations, but your users are more likely to think in terms of a street address. Android includes a geocoder that you can use to convert back and forth between latitude/longitude values and real-world addresses. Finally, you'll be introduced to the Awareness API that helps you understand and react to changes in your user’s context. The Awareness API combines device state with the results from a dozen different sensors, and additional web-sourced environmental information such as weather. It provides access to this information through snapshots or “fences” in a way that’s fast and battery efficient. Professional AndroidLearn hands-on how to leverage the latest features of Android to create powerful apps. This book covers best practices; the anatomy, lifecycle, and UI metaphor of Android apps; designing for all mobile platforms, including tablets; and utilizing both the Android framework and Google Play services. Start your subscription today and you'll get access to this book, plus 300+ other web design and development books in SitePoint Premium! New subscribers can currently get 60% off for the first three months. That’s $3 a month to access all of our tech books and courses — grab the deal here. Until next time, |