Google I/O 2018: What’s new in Android


Posted By Stephanie Cuthbertson, Product Management Director, Android

As Android has grown exponentially over the past ten years, we’ve also seen our developer community grow dramatically. In countries like China, India, and Brazil, the number of developers using our IDE almost tripled – in just two years. With such growth, we feel an even greater responsibility to invest in our developer experience. Guided by your feedback, we’ve focused our efforts on making mobile development fast and easy, helping you get more users by making apps radically smaller, and increasing engagement to keep users coming back. We’re also pretty excited to see Android Things go to 1.0, creating new opportunities for you to develop – everything from major consumer devices, to cool remote control vehicles! As Day 1 of Google I/O kicks off, let’s take a closer look at these major themes from the Developer Keynote:

Development: making mobile development fast and easy

  • Android Jetpack — Today, we announced Android Jetpack, designed to accelerate your app development. Android Jetpack is the next generation of Android components, bringing together the benefits of the Support Library — backwards compatibility and immediate updates — to a larger set of components, making it quick and easy to build robust, high quality apps. Android Jetpack manages activities like background tasks, navigation, and lifecycle management, so you can eliminate boilerplate code and focus on what makes your app great. Android Jetpack is designed to work well with Kotlin, saving you even more code with Android KTX. The new Android Jetpack components released today include WorkManager, Paging, Navigation, and Slices.

  • Kotlin — Since announcing support for Kotlin last year, the developer community has embraced the language. Most importantly, 95% of developers tell us they are very happy with using Kotlin for their Android development. And, the more developers use it, the more that number rises. The number of Play Store apps using Kotlin grew 6x in the last year. 35% of pro developers use it, and that number is growing each month. We are continuing to improve the Kotlin developer experience across our libraries, tooling, runtime, documentation and training. Android KTX is launching today as part of Android Jetpack to optimize the Kotlin developer experience. Tooling continues to improve with Android Studio, Lint support, and R8 optimizations. We have even tuned the Android Runtime (ART) in Android P, so that apps built with Kotlin can run faster. We have rolled out Kotlin code snippets in our official documentation, and are publishing a Kotlin version of the API reference documentation today. Earlier this week, we launched a new Kotlin Bootcamp on Udacity, which is a great resource for developers who are new to Kotlin. Lastly, we now have a Kotlin specialization in the Google Developers Experts Program. If you still haven’t used Kotlin, I hope you you give it a try.
  • Android Studio 3.2 CanaryAndroid Studio 3.2 features tools for Android Jetpack including a visual Navigation Editor and new code refactoring tools. The canary release also includes build tools to create the new Android App Bundle format, Snapshots in the Android Emulator for fast start time, new R8 optimizer for smaller download and install app code size, a new Energy Profiler to measure app impact on battery life, and more. You can download the latest version of Android Studio 3.2 from the canary channel download page.

Distribution: making apps radically smaller

Introducing Android App Bundle.

  • Android App Bundle & Google Play Dynamic Delivery — Introducing the new app model for Android. Dramatically reduce app size with a new publishing format—the Android App Bundle. In Android Studio, you’ll now build an app bundle that contains everything your app needs for any device—all the languages, every device screen size, every hardware architecture. Then, when a user downloads your app, Google Play’s new Dynamic Delivery will only deliver the code and resources matching the user’s device. People see a smaller install size on the Play Store, can download your app more quickly, and save space on their devices. An example of all resources being delivered to a device via a legacy APK and an example of Dynamic Delivery serving just what’s needed to a device.
    (Left) An example of all resources being delivered to a device via a legacy APK.
    (Right) An example of Dynamic Delivery serving just what’s needed to a device.
  • Dynamic features via the Android App Bundle — The Android App Bundle also enables modularization so that you can deliver features on-demand, instead of during install. You can build dynamic feature modules in the latest Android Studio canary release. Join our beta program to publish them on Google Play.
  • Google Play Console — New features and reports in the Play Console will help you improve your app’s performance and grow your business. Read about the improvements to the dashboard, statistics, Android vitals, pre-launch report, acquisition report, and subscriptions dashboard. You can also upload, test, and publish apps using our new publishing format, the Android App Bundle.
  • Google Play Instant — After launching in beta at GDC, today we announced that all game developers can build instant apps and we’re thrilled to welcome Candy Crush Saga. Google Play Instant is now available on over 1 billion devices worldwide from the Play Store, search, social and most places you can tap a link. To make instant apps easier to build, we are launching a Unity plugin and beta integration with Cocos creator this week. Recently, we’ve started testing Google Play Instant compatibility with AdWords, allowing people to try out games directly from ads, across all the channels reached by Universal App campaigns.

Engagement: bringing users back more and more.

  • Slices Slices are UI templates that display a rich array of dynamic, and interactive content from your app, across Android and within Google surfaces. Slices can include live-data, scrolling content, inline actions, and deep-linking into your app so users can do everything from playing music to checking reservation updates. Slices can also contain interactive controls like toggles and sliders. You can get started building Slices today, and they will begin appearing for users soon.
Check reservations with Slices.Control music with Slices.Call a Lyft using Slices.
  • Actions — Actions are a new way to make your app’s capabilities and content more accessible, so that people can easily get to it at the right moment. App Actions will appear to users based on usage and relevance, across multiple Google and Android surfaces, such as the Google Search App, the Play Store, the Google Assistant, and the Launcher. App Actions will be available for all developers to try soon, please sign up here if you’d like to be notified. You can also choose to build a Conversational Action as a companion experience to your app. This works on a variety of Assistant-enabled devices, such as speakers and smart displays. Both types of Actions use a new common catalog of intents.

Actions are a new way to make your app's capabilities and content more accessible, so that people can easily get to it at the right moment.

Smarter devices: a powerful platform for IoT devices

  • Android Things 1.0 Android Things is Google’s managed OS that enables developers to build and maintain Internet of Things devices at scale. Earlier this year at CES, we announced Lenovo, Harman, LG, and iHome are all building Assistant-enabled products powered by Android Things. Introducing Android Things 1.0! After a developer preview with over 100,000 SDK downloads and feedback from more than 10,000 developers, we announced Android Things 1.0 this week. Four new System-on-Modules (SoMs) are now supported on the platform with guaranteed long-term support for three years and additional options for extended support, making it easier to go from prototypes to production. To make product development more seamless than ever, the accompanying Android Things Console is also ready for production. It helps developers easily manage and update their devices with the latest stability fixes and security updates provided by Google.

To get started with Android Things, visit our developer site and the new Community Hub to explore kits, sample code, community projects, and join Google’s IoT Developers Community to stay updated. We introduced a limited program to partner with the Android Things team for technical guidance and support building your product. If your company is interested, sign up for our OEM Partner Program.
In addition to all these new developments, we’re on the ground in over 140 countries, growing and expanding the developer community through programs such as Women Techmakers and Google Developer Groups (GDGs). We’re investing in training programs like Google Developers Certification, building more courses through Udacity and other partners, to help developers deepen their technical capability. Today, 225 Google Developers Agency Program members from 50 agencies in 15 countries, are Android Certified. As part of our Google Developers Experts Program, we also now have more than 90 Android Developer Experts around the world actively supporting developers, start-ups and companies to build and launch innovative apps.
We also continue to recognize the great work from top app and game developers. This year, we held our third annual Google Play Awards. The nominees represent some of the best experiences available on Android, with an emphasis on overall quality, strong design, technical performance, and innovation. Check out the winners and nominees.
During Google I/O, attendees and viewers have an opportunity to dive deep with 48 Android & Play breakout sessions. Thank you for all your wonderful feedback, and please keep giving us your advice on where we should go next.

Use Android Jetpack to Accelerate Your App Development

Posted by Chris Sells, Benjamin Poiesz, Karen Ng, Product Management, Android Developer Tools

Today we’re excited to introduce Android Jetpack, the next generation of components, tools and architectural guidance to accelerate your Android app development.

Android Jetpack was inspired by the Support Library, a set of components to make it easy to take advantage of new Android features while maintaining backwards compatibility; it’s currently used by 99% of every app in the Play Store. Following on that success, we introduced the Architecture Components, designed to make it easier to deal with data in the face of changes and the complications of the app lifecycle. Since we introduced those components at I/O just one year ago, an overwhelming number of you have adopted them. Companies such as LinkedIn, Zillow and iHeartRadio are seeing fewer bugs, higher testability and more time to focus on what makes their app unique.

The Android developer community has been clear — not only do you like what we’ve done with these existing components, but we know that you want more! And so more is what you get.

What is Android Jetpack?

Android Jetpack is a set of components, tools and guidance to make great Android apps. The Android Jetpack components bring together the existing Support Library and Architecture Components and arranges them into four categories:

Android Jetpack components are provided as “unbundled” libraries that are not part of the underlying Android platform. This means that you can adopt each component at your own speed, at your own time. When new Android Jetpack functionality is available, you can add it to your app, deploy your app to the Play Store and give users the new features all in a single day (if you’re quick)! The unbundled Android Jetpack libraries have all been moved into the new androidx.* namespace (as described in detail in this post).

In addition, your app can run on various versions of the platform because Android Jetpack components are built to provide their functionality independent of any specific version, providing backwards compatibility.

Further, Android Jetpack is built around modern design practices like separation of concerns and testability as well as productivity features like Kotlin integration. This makes it far easier for you to build robust, high quality apps with less code. While the components of Android Jetpack are built to work together, e.g. lifecycle awareness and live data, you don’t have to use all of them — you can integrate the parts of Android Jetpack that solve your problems while keeping the parts of your app that are already working great.

We know that these benefits are important to you because of feedback like this:

“We had been thinking of trying out MVVM in our code base. Android Architecture Components gave us an easy template to implement it. And it’s helped make our code more testable as well; the ability to unit test ViewModels has definitely increased code robustness.”

— Sumiran Pradhan, Sr. Engineer, Zillow

If you want to learn more about how companies are using Android Jetpack components, you can read the developer stories on the Android Developer site.

And finally, as you can see from the Android Jetpack diagram above, today we’re announcing new components as well.

What’s New

Android Jetpack comes with five new components:

  • WorkManager alpha release
  • Navigation alpha release
  • Paging stable release
  • Slices alpha release
  • Android KTX (Kotlin Extensions) alpha release

WorkManager

The WorkMananager component is a powerful new library that provides a one-stop solution for constraint-based background jobs that need guaranteed execution, replacing the need to use things like jobs or SyncAdapters. WorkManager provides a simplified, modern API, the ability to work on devices with or without Google Play Services, the ability to create graphs of work, and the ability to query the state of your work. Early feedback is very encouraging but we love to make sure that your use cases are covered, too. You can see what we have so far and provide feedback on our alpha on the WorkManager component.

Navigation

While activities are the system provided entry points into your app’s UI, their inflexibility when it comes to sharing data between each other and transitions has made them a less than ideal architecture for constructing your in-app navigation. Today we are introducing the Navigation component as a framework for structuring your in-app UI, with a focus on making a single-Activity app the preferred architecture. With out of the box support for Fragments, you get all of the Architecture Components benefits such as Lifecycle and ViewModel while allowing Navigation to handle the complexity of FragmentTransactions for you. Further, the Navigation component allows you to declare transitions that we handle for you, automatically builds the correct Up and Back behavior, includes full support for deep links, and provides helpers for connecting Navigation into the appropriate UI widgets, like the navigation drawer and bottom navigation. But that’s not all! The Navigation Editor in Android Studio 3.2 allows you to see and manage your navigation properties visually:

The Navigation component is also in alpha and we’d love your feedback.

Paging

Data presented in an app can be large and costly to load, so it’s important to avoid downloading, creating, or presenting too much at once. The Paging component version 1.0.0 makes it easy to load and present large data sets with fast, infinite scrolling in your RecyclerView. It can load paged data from local storage, the network, or both, and lets you define how your content gets loaded. It works out of the box with Room, LiveData, and RxJava.

Slices

And finally, to round out the set of new features making their debut in Android Jetpack is the Slices component. A “slice” is a way to surface your app’s UI inside of the Google Assistant as a result of a search:

You can learn all about the Slices component and how to integrate it into your app on the Android Developer website.

Android KTX

And last but not least, one goal of Android Jetpack takes advantage of Kotlin language features that make you more productive. Android KTX lets you transform Kotlin code like this:

view.viewTreeObserver.addOnPreDrawListener(
  object : ViewTreeObserver.OnPreDrawListener {
    override fun onPreDraw(): Boolean {
      viewTreeObserver.removeOnPreDrawListener(this)
      actionToBeTriggered()
      return true
    }
});

into more concise Kotlin code like the following:

view.doOnPreDraw { actionToBeTriggered() }

This is just the first step in bringing Kotlin support to Android Jetpack components; our goal is to make Android Jetpack great for Kotlin developers (and of course Java developers!).You can read more about Android KTX on the Android Developer web site.

Getting Started

You can get started with Android Jetpack at developer.android.com/jetpack. You’ll find docs and videos for Android Jetpack, see what’s new in Android Jetpack components, participate in the community and give us feedback. We’ve also created a YouTube playlist devoted to Android Jetpack, so you can tune in for information about Android Jetpack, components, tools and best practices.

Getting Started with Android Jetpack will tell you how to bring the Android Jetpack components into your existing apps and help you get started with new Android Jetpack apps. Android Studio 3.2 has great tooling support for Android Jetpack. For building new apps, use the Activity & Fragment+ViewData activity, which you can get to from File | New | New Project in Android Studio:

What’s Next

With Android Jetpack, we’re taking the benefits of the Support Library and the Architecture Components and turning it up a notch with new components, Android Studio integration and Kotlin support. And while Android Jetpack provides the next generation components, tools and guidance to accelerate your Android development, we’ve got a lot more that we want to do and we want your help. Please go to developer.android.com/jetpack and let us know what we can do to make your experience building Android apps even better.

Hello World, AndroidX

Posted by Alan Viverette (/u/alanviverette), Kathy Kam (@kathykam) , Lukas Bergstrom (@lukasb)

Today, we launch an early preview of the new Android extension libraries (AndroidX) which represents a new era for the Support Library. Please previe…