1 / 66

Android 16: Location

Android 16: Location. Kirk Scott. 16.1 Introduction 16.2 Google Services 16.3 Google Play Services 16.4 Location APIs 16.5 Making Your App Location Aware. 16.1 Introduction. This unit belongs to the third third of the course

coty
Télécharger la présentation

Android 16: Location

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android 16: Location Kirk Scott

  2. 16.1 Introduction • 16.2 Google Services • 16.3 Google Play Services • 16.4 Location APIs • 16.5 Making Your App Location Aware

  3. 16.1 Introduction • This unit belongs to the third third of the course • It covers a topic that might be of some interest when developing your final project

  4. Unless you planned it up front, it’s unlikely that you could randomly add location • However, this is a worthwhile topic to consider since it’s part of what makes Android mobile devices so interesting

  5. The full title of the related section in the API guide is “Location and Sensors” • This section in the API guides consists of the subsections listed on the following overhead

  6. Location and Maps • Location Strategies • Sensors Overview • Motion Sensors • Position Sensors • Environment Sensors

  7. What’s shown on the following two overheads is what you find if you go to the section on Location and Maps

  8. Location and Maps • Note: • This is a guide to the Android framework location APIs in the package android.location. • The Google Location Services API, part of Google Play Services, provides a more powerful, high-level framework that automates tasks such as location provider choice and power management. • Location Services also provides new features such as activity detection that aren't available in the framework API.

  9. Developers who are using the framework API, as well as developers who are just now adding location-awareness to their apps, should strongly consider using the Location Services API. • To learn more about the Location Services API, see Google Location Services for Android.

  10. So the moral of the story is that this set of overheads will not cover any technical content • It will just cover the overview information on the services structure for supporting location in Android apps • It will conclude with the introduction to the training section, where the reader could go for technical content

  11. 16.2 Google Services

  12. Google Services • Google offers a variety of services that help you build new revenue streams, manage app distribution, track app usage, and enhance your app with features such as maps, sign-in, and cloud messaging. • Although these Google services are not included in the Android platform, they are supported by most Android-powered devices. • When using these services, you can distribute your app on Google Play to all devices running Android 2.2 or higher, and some services support even more devices.

  13. Google Maps • Include the power of Google Maps in your app with an embeddable map view. • You can customize the map with markers and overlays, control the user's perspective, draw lines and shapes, and much more.

  14. Google Play In-App Billing • Build an app with a steady revenue stream that keeps users engaged by offering new content or virtual goods directly in your app. • All transactions are handled by Google Play Store for a simple user experience.

  15. Google+ • Allow users to sign in with their Google account, customize the user experience with Google+ info, pull people into your app with interactive posts, and add +1 buttons so users can recommend your content.

  16. Google Wallet Instant Buy • Provide fast and easy checkout in your app when selling physical goods and services. • Increase conversions by streamlining your purchase flow and reducing the amount of information your customers need to enter.

  17. Google Cloud Platform • Build and host the backend for your Android app at Google-scale. • With an infrastructure that is managed automatically, you can focus on your app. • Then, scale to support millions of users.

  18. Google Analytics • Measure your success and gain insights into how users engage with your app content by integrating Google Analytics. • You can track in-app purchases, the number of active users, interaction patterns, and much more.

  19. Google Cloud Messaging • Immediately notify your users about timely events by delivering lightweight messages from your web server. • There are no quotas or charges to use Google Cloud Messaging.

  20. Google Mobile Ads • Display ads from Google Mobile Ads offer you an alternative revenue opportunity that leverages multiple ad networks with targeted ads and several display formats.

  21. 16.3 Google Play Services

  22. Google Play Services • Give your apps more features to attract users on a wider range of devices. • With Google Play services, your app can take advantage of the latest, Google-powered features such as Maps, Google+, and more, with automatic platform updates distributed as an APK through the Google Play store. • This makes it faster for your users to receive updates and easier for you to integrate the newest that Google has to offer.

  23. Google Technology • Google Play services provides you with easy access to Google services and is tightly integrated with the Android OS. • Easy-to-use client libraries are provided for each service that let you implement the functionality you want easier and faster.

  24. Standard Authorization • All products in Google Play services share a common authorization API that leverages the existing Google accounts on the device. • You and your users have a consistent and safe way to grant and receive OAuth2 access tokens to Google services.

  25. Automatic Updates • Devices running Android 2.2 and newer and that have the Google Play Store app automatically receive updates to Google Play services. • Enhance your app with the most recent version of Google Play services without worrying about your users' Android version.

  26. To start integrating Google Play services into your app, follow the Setup guide.

  27. How It Works • The Google Play services client library • The client library contains the interfaces to the individual Google services and allows you to obtain authorization from users to gain access to these services with their credentials.

  28. It also contains APIs that allow you to resolve any issues at runtime, such as a missing, disabled, or out-of-date Google Play services APK. • The client library has a light footprint if you use ProGuard as part of your build process, so it won't have an adverse impact on your app's file size.

  29. If you want to access added features or products, you can upgrade to a new version of the client library as they are released. • However, upgrading is not necessary if you don't care about new features or bug fixes. • We anticipate more Google services to be continuously added, so be on the lookout for these updates.

  30. The Google Play services APK • The Google Play services APK contains the individual Google services and runs as a background service in the Android OS. • You interact with the background service through the client library and the service carries out the actions on your behalf.

  31. An easy-to-use authorization flow is also provided to gain access to the each Google service, which provides consistency for both you and your users. • The Google Play services APK is delivered through the Google Play Store, so updates to the services are not dependent on carrier or OEM system image updates.

  32. In general, devices running Android 2.2 (Froyo) or later and have the Google Play Store app installed receive updates within a few days. • This allows you to use the newest APIs in Google Play services and reach most of the devices in the Android ecosystem (devices older than Android 2.2 or devices without the Google Play Store app are not supported).

  33. The Google Play services APK on user devices receives regular updates for new APIs, features, and bug fixes.

  34. The benefits for your app • Google Play services gives you the freedom to use the newest APIs for popular Google services without worrying about device support. • Updates to Google Play services are distributed automatically by the Google Play Store and new versions of the client library are delivered through the Android SDK Manager.

  35. This makes it easy for you to focus on what's important: your users' experience. • To get started, set up the SDK and check out the various products in the Google Play services platform now!

  36. 16.4 Location APIs

  37. Location APIs • The location APIs make it easy for you to build location-aware applications, without needing to focus on the details of the underlying location technology. • They also let you minimize power consumption by using all of the capabilities of the device hardware.

  38. To get started, first set up the Google Play services SDK. • You can learn how to use the APIs in the training class Making Your App Location Aware, and details are available in the Location API reference.

  39. Key Developer Features • Fused location provider • The Fused Location Provider intelligently manages the underlying location technology and gives you the best location according to your needs.

  40. Simple APIs: • Lets you specify high-level needs like "high accuracy" or "low power", instead of having to worry about location providers. • Immediately available: • Gives your apps immediate access to the best, most recent location.

  41. Power-efficiency: • Minimizes your app's use of power. • Based on all incoming location requests and available sensors, fused location provider chooses the most efficient way to meet those needs.

  42. Versatility: • Meets a wide range of needs, from foreground uses that need highly accurate location to background uses that need periodic location updates with negligible power impact.

  43. Geofencing APIs • Lets your app setup geographic boundaries around specific locations and then receive notifications when the user enters or leaves those areas.

  44. Simple but powerful APIs: • Allows batch addition and removal of geofences. • Ability to manage multiple geofences at the same time. • Ability to filter alerts for both entry and exit or entry only or exit only.

More Related