Tag Archives: googleservices

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.

Android M Developer Preview & Tools

By Jamal Eason, Product Manager, Android

Today at Google I/O, we announced a developer preview of the next version of Android, the M release. Last year’s developer preview was a first for Android and we received great feedback. We want to continue to give you developers early access to Android so you have time to get your apps ready for the next version of Android. This time with the M Developer Preview, we will provide a clear timeline for testing and feedback plus more updates to the preview build.

Visit the M Developer Preview for downloads and documentation

The Android M release: improving the fundamentals

For the M release, we focused on improving the core user experience of Android, from fixing thousands of bugs, to making some big changes to the fundamentals of the platform:

  • Permissions - We are giving users control of app permissions in the M release. Apps can trigger requests for permissions at runtime, in the right context, and users can choose whether to grant the permission. Making permission requests right when they’re needed means users can get up and running in your app faster. Also, users have easy access to manage all their app permissions in settings. On M, as a developer, you should design your app to prompt for permissions in context and account for permissions that don’t get granted. As more devices upgrade to M, app permission behavior will be a critical development flow to test.
  • Runtime App Permissions

  • App links - We are making it even easier to link between apps. Android has always allowed apps to register to natively handle URLs. Now you can add an autoVerify attribute to your app manifest so that users can be linked deep into your native app without any disambiguation prompt. App links, along with App Indexing for Google search, make it easier for users to discover and re-engage with your app.
  • Battery - We’re making Android devices smarter about managing power through a new feature called Doze. With M, Android uses significant motion detection to learn if a device has been left unattended for a while. In this state, Android will exponentially back off background activity, trading off a little bit of app freshness for longer battery life. Consider how this may affect your app; for instance, if you’re building a chat app, you may want to make use of high priority messages to wake your app when the device is dozing.

The Android M release: advancing assistance and payments

We are also delighted to announce a couple of big new features:

  • Now on tap - We are making it even easier for Android users to get assistance with Now on tap -- whenever they need it, wherever they are on their device. For example, if your friend texts you about dinner at a new restaurant, without leaving the app, you can ask Google Now for help. Using just that context, Google can find menus, reviews, help you book a table, navigate there, and deep link you into relevant apps. As a developer, you can implement App Indexing for Google search to let users discover and re-engage with your app through Now on tap.
  • Now on tap

  • Android Pay & Fingerprint - We’ve built on our work with Near Field Communications (NFC) in Gingerbread and Host Card Emulation in Kitkat to develop Android Pay. Android Pay will enable Android users to simply and securely use their Android phone to pay in stores or in thousands of Android Pay partner apps. With M, native fingerprint support enhances Android Pay by allowing users to confirm a purchase with their fingerprint. Moreover, fingerprint on M can be used to unlock devices and make purchases on Google Play. With new APIs in M, it’s easy for you to add fingerprint authorization to your app and have it work consistently across a range of devices and sensors.

These are just a few highlights from the M Developer Preview that we announced today. The M preview will be available for download right after the keynote.

Android Developer Tools

In addition to the developer preview, we are launching new tools to help you in the development of your Android App:

  • Android Studio v1.3 Preview - To help take advantage of the M Developer Preview features, we are releasing a new version of Android Studio. Most notable is a much requested feature from our Android NDK & game developers: code editing and debugging for C/C++ code. Based on JetBrains Clion platform, the Android Studio NDK plugin provides features such as refactoring and code completion for C/C++ code alongside your Java code. Java and C/C++ code support is integrated into one development experience free of charge for Android app developers. Update to Android Studio v1.3 via the Canary channel and let us know what you think.
  • Android Studio 1.3 with Android NDK Support

  • Android Design Support Library - Making Material design apps gets even easier with the new Android Design support library. We have packaged a set a key design components (e.g floating action button, snackbar, navigation view, motion enabled Toolbars) that are backward compatible to API 7 and can be added to your app to create a modern, great looking Android app without building everything from scratch.
  • Google Play Services - Today we also are releasing v7.5 of Google Play services which includes new features ranging from Smart Lock for Passwords, new APIs for Google Cloud Messaging and Google Cast, to Google Maps API on Android Wear devices.

Get Started

The M Developer Preview includes an updated SDK with tools, system images for testing on the official Android emulator, and system images for testing on Nexus 5, Nexus 6, Nexus 9, and Nexus Player devices. We are excited to expand the program and give you more time to ensure your apps support M when it launches this fall. Based on your feedback, we plan to update the M Developer preview system images often during the developer preview program. The sooner we hear from you, the more feedback we can integrate, so let us know!

To get started with the M Developer Preview and prepare your apps for the full release, just follow these steps:

  1. Update to Android Studio v1.3+ Preview
  2. Visit the M Developer Preview site for downloads and documentation.
  3. Explore the new APIs & App Permissions changes
  4. Explore the Android Design Support Library & Google Play Services APIs
  5. Get the emulator system images through the SDK Manager or download the Nexus device system images.
  6. Test your app with your supported Nexus device or emulator
  7. Give us feedback