-I’m Kurt, a Product Manager for Google Play Services.
Today, I’m going to show you how you can build powerful and reliable Android apps
using the latest Google features and technologies
while reaching as many users as possible.
Android is the world’s most popular operating system with more than 2.5 billion
monthly active Google-certified devices worldwide.
The ecosystem continues to grow, and the pace of innovation
has never been greater, offering users choice and diversity.
Android Auto is currently available with nearly every major car manufacturer,
while Android TV is used by seven of the top 10 smart TV OEMs worldwide.
By working with manufacturers and carrier partners around the world,
we’re making Android’s helpful innovations more accessible for everyone.
This represents a massive opportunity for developers to reach users.
However, it also comes with challenges.
In order to fully tap into this massive user base,
developers not only need to build rich engaging experiences,
but do so in a way that works across the diversity of the ecosystem.
This means building apps that work across several versions of Android
and adapt to different screen sizes and device capabilities.
It also means building apps that extend their experiences
across the range of devices in the Google Play ecosystem
like wearables, TVs, and cars.
Google Play Services helps by making the latest Google features
and technologies available across versions of Android and devices.
However, access to Google features is only one piece of the puzzle,
For the last several years, we’ve been working on solutions
to address these challenges across the board.
So before we dive into Google Play Services,
let's take a look at a few of these investments
to understand how they relate and where Play Services fits in.
To help deliver the latest OS improvements to more Android devices,
we've invested in Treble and Mainline.
Project Treble separates the low-level device-specific software,
written in large part by the Silicon manufacturers,
from the Android OS framework.
With the Android OS framework abstracted from the underlying details,
it can be more easily updated across devices.
Project Mainline, also known as Google Play System Updates,
enables us to update core OS components in a way that’s similar
to the way that we update apps through Google Play.
With this approach, we can deliver select AOSP components faster
and for a longer period of time
without needing a full, over the year update from a device manufacturer.
Mainline components are still open-sourced,
and we’re working closely with our partners on code contribution and testing.
In fact, our partners contributed many of the changes
of the initial set of Mainline components
and collaborated with us to ensure they ran well on their devices.
With each release, we continue to add to the number of core AOSP components
that can be updated via Mainline.
Now we get to Google Play Services,
which runs in the background on every Google-certified device.
It’s the underlying set of APIs and services that deliver the rich user experiences
and the privacy and security features that users get expect from Google.
For example, backup and restore, emergency location services,
and Find My Device are all powered by Play Services.
For developers, Google Play Services powers several SDKs making them broadly available.
This gives you consistent access to Google APIs and services
across the diversity of the ecosystem.
You can access each of these services
from your app using a respective thin client library.
We'll discuss this in more detail in a minute.
Android Jetpack is suite of libraries, tools, and guidance to help developers
follow best practices, reduce boilerplate code,
and write code that worked consistently across Android versions and devices.
For example, Work Manager provides a consistent approach
to handling background work while abstracting away
the specific implementation for a given platform version.
In other words, Google handles the complexity for you
so you can focus on the code you care about.
Last but not least, we have Jetpack Compose, Android’s modern UI toolkit
designed to make it faster and easier to build native apps
across all Android platforms.
Compose offers modern declarative Kotlin APIs,
helping you build powerful, responsive apps with way less code.
It's built to integrate with existing apps and Jetpack libraries.
You can adopt Compose at your own pace by combining Android Views and Compose.
To summarize, Google Play System updates help to address the updatability
of the core operating system.
Google Play Services provides consistent access to Google APIs and services.
Jetpack is our set of unbundled libraries that help you accommodate for fragmentation
across devices in your app code.
And Compose simplifies and accelerates UI development on Android.
Collectively, these technologies help to address
many of the challenges developers face when targeting the entire ecosystem.
Great, now we’ve had the whirlwind tour and see where Google Play Services
fits in the bigger picture,
let’s take a look at how it works and what it provides developers.
SDKs powered by Google Play Services
are unique in that they only require a thin client library
so your app stays small.
If you’re using Android Studio 3.4 or higher and enable code shrinking,
the R8 optimizer can help further reduce the footprint
of each SDK and its impact on your app’s package size.
To access new Google Play Services’ features or products,
update the SDK whenever a new version is released to the Google Maven repository.
Here's how it works.
At runtime, the client library communicates with the bulk of the SDK’s implementation
and footprint in Google Play Services.
These on-device services run in the background
on every Google-certified Android device.
By providing shared on-device implementations,
Google Play Services helps to optimize on-device resources
such as storage, memory, and battery to improve your user’s overall experience.
It also enables the SDK’s Powered by Play services to be backward compatible,
enabling you to reach more users with less effort.
Play Services is updated automatically,
independent of OS, OEM, carrier, or app updates
so that your users receive improvements and bug fixes more quickly.
In general, Google-certified devices running Android 4.1 or higher
receive updates as long as they have sufficient storage available.
In addition to phones, Google Play Services also runs on tablets,
Android TVs, wearables, cars, and Chrome OS, making relevant APIs available on each.
This means that you can build rich user experiences
with Google APIs and services across devices and platform versions
without building everything into your app.
Google Play Services powers a broad set of SDKs on Android
to help you build your app, enhance privacy and security,
engage users, and grow your business.
Several products your users are already familiar with are available,
including Google Maps, Cast, Google Pay, Play Games, Wear, Fitness and more.
Grow your business with SDKs like AdMob and Google Analytics
and leverage battery-efficient platform services
like Location and Firebase Cloud Messaging for push notifications.
Let Google do the heavy lifting with on-device capabilities like ML KIT,
Nearby, and Activity Recognition.
Security and privacy APIs like SafetyNet, reCAPTCHA, FIDO and Security Provider
are foundational services to ensure your apps are running on trusted devices,
help to reduce spam and increase user safety.
Cool. That was a quick look
at how Google Play Services works and can help you build powerful
and reliable apps with Google features
and technologies for the entire Play ecosystem.
Now let's dive into a few exciting updates and take a look at what's new.
First up is the work we’ve been doing for the urban wrong side of street problem.
This is the most important location problem reported by Android OEM
and developer partners.
Accurate urban location is critical to rideshare apps
and for walking navigation in cities.
GPS chips assume that the satellite signal is line of sight.
However, in urban environments, the GPS signal reflects off the buildings.
This introduces error due to the excess path length the signal travels.
The most common side effect is your position appears on the wrong side of the street,
although your position can appear on the wrong city block
especially in very large cities with many skyscrapers.
There have been attempts to address this problem for more than a decade,
but no solution existed at scale
until 3D mapping-aided corrections were launched on Android.
Our solution uses 3D mapping-aided corrections
and is only feasible to be done at scale by Google
because it comprises 3D building models, raw GPS measurements, and machine learning.
The first version of this technology rolled out to all phones
running Android 8 and above last year via Google Play Services,
and reduced the wrong side of street errors by 50%.
A second version rolled out earlier this year,
reducing wrong side of street occurrences by approximately 75%.
The team is now working on the third version,
which will unlock the magic of the new GNSSL5 signal
to conclude the end game of urban navigation.
The third version is expected to be at 90% improvement,
matching what we currently achieve on the server, but calculated on device.
Here are quotes from industry partners we’re working with
to bring this innovation to market,
testifying to the fact the third version will bring sidewalk-level accuracy.
This is a case where we were able to solve a massively complex problem at Google scale
and deliver the solution broadly to the ecosystem with Google Play Services.
If your app uses FusedLocation provider,
this API will just start working better automatically.
Next up is ML Kit, which brings Google’s machine learning expertise
to mobile developers in a powerful and easy-to-use package.
Using ML Kit, you can make your apps more engaging, personalized,
and helpful with solutions that are optimized to run on device.
With the work that we’ve been doing to bring ML Kit into Google Play Services,
you can now take advantage of face detection, image labeling, text recognition
and barcode scanning while keeping your apps small.
For example, the standalone Barcode SDK is 4.8 megabytes
but its Play Service’s client library is only 300 K.
Similarly, the standalone Image Labelling SDK is 2.2 megabytes,
and its Play Services client is only around 300 K.
The Play Services implementation of ML Kit
also benefits from shared on-device models that are used across apps
and receive automatic updates to improve quality,
without you needing to release a new version of your app.
We’re also using Play Services to enable hardware acceleration
on more devices over time, delivering specialized vendor drivers
that implement NNAPI used by TensorFlow Lite.
This efficiently distributes the computation workload
across available on-device processors, including dedicated neural network hardware,
graphics processing units, and digital signal processors.
This means the experiences you build will run faster on more devices over time.
In fact, these enhancements to ML Kit are enabled by Android’s new, updateable,
fully-integrated ML inference stack.
It provides everything needed for on-device inference by default.
No need to bundle this code into your app.
The integration with Android is optimized to deliver the best performance
on CPU and beyond including when to enable hardware acceleration.
It also provides a consistent API that spans Android versions
with automatic updates through Google Play Services.
As mentioned, Google SDKs like ML Kit are being built on top of this stack.
If you use them, you’ll get these benefits for free.
However, we’re also making this fully-integrated stack available
directly to developers to enable you to make your own amazing ML-powered experiences.
Next up is a new Play Game Services SDK that will be released in the coming weeks
to help you integrate popular gaming features into your games.
The new SDK simplifies the process of integrating Play Game Services into your app.
We’ve also optimized the account creation and sign-in flows
so that more users successfully get into your game faster.
Let's take a look at the simplified integration.
Here’s an example of what you previously needed to write in order to sign into a game.
Don’t worry about trying to read it.
It took a decent amount of code and an understanding of the flow control.
Here's an equivalent example using the new simplified games SDK.
You simply instantiate an instance of the game’s sign-in client,
check to see if the user’s authenticated and handle the task callback.
With this approach, sign-in is automatically triggered
when the user opens the game.
To simplify set up for new users, we've combined Play Games account creation
and Play Games app installation into one step.
Previously, users were required to create their Play Games account
and install the Play Games app as two separate steps.
By combining these two steps, new users can finish initial setup
and get to gameplay more quickly.
Opting into auto sign-in across all games
that integrate Play Game Services has also been streamlined
so that more users can jump straight in your game without having to manually sign in.
We’ve also been making some updates across our SDKs
to improve the experience of using Google Play Services with Kotlin.
We’ve been adding nullability annotations to our API surface
so that you can take advantage of null safety from your Kotlin code
with Play Services APIs.
These are being introduced as Kotlin compiler warnings
but will be eventually upgraded to errors in an eventual breaking change.
We’ve also recently released a sample app and supporting documentation
showing how to use the tasks API with Kotlin coroutines.
Let's take a look.
On the top portion of this slide,
you can see how you would traditionally handle the callback for a task.
Below, you can see that the tasks API seamlessly integrate with Kotlin concurrency.
So you no longer need to think about task-specific patterns or syntax.
You can also use any task-based API, just like any other Kotlin async thread.
That concludes our talk of how Google Play Services can help you build
powerful, reliable apps for the most users,
the breadth of SDKs that it powers, and a few exciting updates.
For more updates, developer guides, release notes, and other resources,
head over to developers.google.com/android.
Thanks for watching.