Presentation is loading. Please wait.

Presentation is loading. Please wait.

Android 17: Location Kirk Scott.

Similar presentations


Presentation on theme: "Android 17: Location Kirk Scott."— Presentation transcript:

1 Android 17: Location Kirk Scott

2

3

4

5 17.1 Introduction 17.2 Google Services 17.3 Google Play Services 17.4 Location APIs 17.5 Making Your App Location Aware

6 17.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

7 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

8 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

9 Location and Maps Location Strategies Sensors Overview Motion Sensors Position Sensors Environment Sensors

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

11 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.

12 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.

13 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

14 17.2 Google Services

15

16 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.

17 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.

18 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.

19 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.

20 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.

21 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.

22 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.

23 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.

24 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.

25 17.3 Google Play Services

26

27 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.

28 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.

29 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.

30 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.

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

32 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.

33 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.

34 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.

35 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.

36 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.

37 In general, devices running Android 2
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).

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

39 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.

40 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!

41 17.4 Location APIs

42

43 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.

44 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.

45 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.

46 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.

47 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.

48 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.

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

50 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.

51 Optimized for battery:
Adjusts location updates based on user’s proximity to the geofence and user’s modality (still, walking, driving, and so on).

52 Activity recognition With apps becoming increasingly contextual, understanding what the user is doing is critical to surfacing the right content. The Activity recognition API makes it easy to check the user’s current activity—still, walking, cycling, and in-vehicle—with very efficient use of the battery.

53 Optimized for battery:
Uses low-power sensors to recognize the user's current physical activity.

54 Enhances other services with context:
Great for adding movement awareness to location awareness. Apps can adjust the amount of location awareness they provide, based on the current user movement. For example, a navigation app can request more frequent updates when the user is driving.

55 Features for advanced applications:
For advanced applications that want to do their own post-processing, this API also makes available confidence values for each of the activities. It also includes two activities that indicate unreliable measurements: unknown and tilt.

56 17.5 Making Your App Location Aware
[Note: This section is taken from the training part of the developers’ Web site.]

57 Making Your App Location-Aware
One of the unique features of mobile applications is location awareness. Mobile users bring their devices with them everywhere, and adding location awareness to your app offers users a more contextual experience.

58 The new Location Services API available in Google Play services facilitates adding location awareness to your app with automated location tracking, geofencing, and activity recognition. This API adds significant advantages over the plaform's location API.

59 This class [training class, not API class] shows you how to use Location Services in your app to get the current location, get periodic location updates, look up addresses, create and monitor geofences, and detect user activities. The class includes sample apps and code snippets that you can use as a starting point for adding location awareness to your own app.

60 Note: Since this class is based on the Google Play services client library, make sure you install the latest version before using the sample apps or code snippets. To learn how to set up the client library with the latest version, see Setup in the Google Play services guide.

61 Lessons Retrieving the Current Location
Learn how to retrieve the user's current location. Receiving Location Updates Learn how to request and receive periodic location updates. Displaying a Location Address Learn how to convert a location's latitude and longitude into an address (reverse geocoding).

62 Creating and Monitoring Geofences
Learn how to define one or more geographic areas as locations of interest, called geofences, and detect when the user is close to or inside a geofence.

63 Recognizing the User's Current Activity
Learn how to recognize the user's current activity, such as walking, bicycling, or driving a car, and how to use this information to modify your app's location strategy.

64 Testing Using Mock Locations
Learn how to test a location-aware app by injecting mock locations into Location Services. In mock mode, Location Services sends out mock locations that you inject instead of sensor-based locations.

65 Summary and Mission This is where this set of overheads ends
For the time being, none of the individual classes will be covered The end of the semester is nearing If anyone is interested, they will have to pursue this on their own

66 The End


Download ppt "Android 17: Location Kirk Scott."

Similar presentations


Ads by Google