A Closer Look at Google Play services 7.5
Posted by Ian Lake, Developer Advocate
At Google I/O, we announced the rollout of Google Play services 7.5 that deliver new capabilities and optimizations to devices across the Android ecosystem. Google Play services ensures that you can build on the latest features from Google for your users, with the confidence that those services will work properly on Android 2.3 and higher devices.
You’ll find the addition of Smart Lock for Passwords, Instance ID, new APIs for Google Cloud Messaging and Google Cast, as well as access to the Google Maps API on Android Wear devices.
Smart Lock for Passwords
Typing in a password, particularly on a mobile device, is never a pleasant experience. In many cases, your users have already logged in on the web or another device - shouldn’t your login process know that? Smart Lock for Passwords builds on the Chrome Password Manager, adding a new CredentialsApi
API and UI on Android to retrieve saved credentials as part of your login process and saving new credentials for later use on other Android devices and any Chrome browser. Both password-based and Identity Provider (IDP, like Google Sign-In) credentials are supported. Keep your users logged in as they move between and to new devices; don’t let them drop off, get frustrated, or end up with multiple accounts.
Learn more about Smart Lock for Passwords on the developer site.
Instance ID, Identity, and Authorization
Instance ID (IID) allows you to retrieve a unique identifier for every app instance, providing a mechanism to authenticate and authorize actions, even if your app does not have user registration and accounts. For example, this allows you to uniquely determine which app instance is sending a request from by including the Instance ID token. We’ve also made it easy to handle edge cases to ensure that you’ll have valid Instance ID tokens.
Google Cloud Messaging
Google Cloud Messaging (GCM) gives developers a battery efficient mechanism for sending information to your users as well as send upstream messages from a device to your server.
Google Cloud Messaging and InstanceID
Previously, GCM used a unique registration ID to refer to each device - while these IDs will continue to work, you can now utilize Instance ID tokens for GCM, gaining all of the advantages of InstanceID around handling error cases. Instance ID tokens are fully compatible with user notifications, allowing you to send notifications to all of a user's devices.
Topic based subscriptions
You’ll also get another new feature for switching to InstanceID with GCM - topic based subscriptions! This makes it easy to publish a message to exactly the right audience and have GCM handle all the heavy lifting of sending to all subscribed instances. Your app can subscribe to multiple topics, allowing you to create any set of topics needed to best handle your app’s messaging needs.
Receiving messages with GCM
Of course, just subscribing to receive messages is only half the battle: receiving GCM messages can now be done using a GcmReceiver
and a subclass of GcmListenerService
. These two classes make it easy to help your app reliably process messages, even when the device is awakened from deep sleep.
GCM Network Manager
Applications often need to sync data with their servers when new information is available. In GCM we refer to this model as “send to sync”. We made this task much simpler with the introduction of the GCM Network Manager APIs, which handles many of the common implementation patterns such as waiting for network connectivity, device charging, network retries, and backoff. GcmNetworkManager
will schedule your background tasks when it is most appropriate and it can batch multiple tasks together for efficiency and battery savings, even utilizing the JobScheduler
APIs for best performance on Android 5.0+ devices. With support for both one-off tasks and periodic tasks, this API serves as a flexible framework for many different types of operations.
App Invites Beta
Now in beta, App Invites is new functionality for both Android and iOS that provides a standard UI for users to invite their contacts to install your app and optionally deep link specifically to selected content, using your users’ device and Google-wide contacts as a source to drive referrals to increase the reach of your app.
With the ability to send invites via SMS or email, this provides a great mechanism to organically grow your user base, give your users a consistent way to share your app with exactly who would like it, and track how effective your invites are.
With App Invites, our goal is to take the hard work out of building user referral and onboarding flows, so that you can focus on your core app experience. Learn more about App Invites on the developer site!
Google Cast
Google Cast is a technology that lets you easily cast content from your mobile device or laptop right to your TV or speakers. With the new ability to use remote display on any Android, iOS, or Chrome app, better media support, better game support, we hope your Google Cast experience is better than ever!
Remote Display API
We are making it easy for mobile developers to bring graphically intensive apps or games to Google Cast receivers with Google Cast Remote Display APIs for Android and iOS. The new Remote Display API allows you to build a tailored, integrated second screen experience, without requiring an identical mirroring of content between mobile devices and the Google Cast device.
Learn more about Remote Display on the Google Cast Developers Site!
Autoplay and Queuing APIs
Playing single media items on Chromecast has been something RemoteMediaPlayer
(or CastCompanionLibrary’s VideoCastController
) has been doing well for some time. With this release, RemoteMediaPlayer
is gaining a full media queue and support for autoplay for a seamless media playback experience. This ensures that all connected devices can easily maintain a synchronized queue of upcoming media items, opening up new possibilities of creating collaborative Google Cast media experiences.
Game Manager APIs for Google Cast
Bringing your game to Google Cast can make for a great multiplayer experience, using a mobile device as a game controller and the TV to display the action. To make it easier to send messages and state changes to all connected clients and the cast receiver, Google Play services 7.5 introduces the GameManagerClient
and the Game Manager APIs for Google Cast, available for Android, iOS, Chrome, and for receivers.
Android Wear
Watches are great devices for telling time. But what if in addition showing you when you are, watches could easily show you where you are? With the new release, you can now use the familiar Maps APIs on Android Wear devices:
This makes it possible to display fully interactive maps, as well as lite mode maps, directly on Android Wear devices. You’ll be able to scroll and zoom interactive maps, show the user’s current location, and more. Check out the full list of supported features in the developer documentation and check out all the details on the Geo Developers blog.
Google Fit
Google Fit is an open platform designed to make building fitness apps, whether that means retrieving sensor data like current location and speed, collecting and storing activity data, or automatically aggregating that data into a single view of the user’s fitness data.
You’ll now be able to use the RecordingApi
for gathering estimated distance traveled and calories burned data, making it available to your app and other Google Fit enabled apps via the HistoryApi
.
Being active can take many forms. While some activities are easily measured in terms of steps or distance, strength training is measured in terms of type, resistance and repetitions. This type of data can now be stored in Google Fit via new support for a large number of workout exercises, helping users build a complete view of their activity.
SDK is now available!
Google Play services 7.5 is now available: get started with updated SDK now!
To learn more about Google Play services and the APIs available to you through it, visit the Google APIs for Android site.
0 comments:
Post a Comment