Image for post
Image for post
Illustration by Virginia Poltrack

Now in Android #20

Android 11 Beta, 11 Weeks of Android, Android 11 Meetups, AndroidX releases, IOSched sample code, articles, videos, new docs, and a couple of podcast episodes. We’ve been busy.

Chet Haase
Jun 24 · 10 min read

Welcome to Now in Android, your ongoing guide to what’s new and notable in the world of Android development.

Remember how last time there wasn’t much to cover? Now you know why; we were saving it up for an avalanche of great developer content that we’ve posted in the past couple of weeks. So this episode is a bit of a long one…

NiA20 in Video and Podcast Form

This is also offered in video and podcast form. It’s the same content, but with less reading required. The article version (keep reading!) is still the place to come for links to all of the content that’s covered.

Video

Podcast

Click on the link below, or just subscribe to the podcast in your favorite client app.


Android 11 Beta… Launched!

Image for post
Image for post

The original plans for a “launch” event for Android 11 changed to a quieter version; we simply made the Beta available, along with several videos covering the details of various features in Android 11, as well as related tools and unbundled libraries.

To learn more about this release and how to take advantage of all of the new capabilities in Android 11 (as well as our tools and unbundled libraries), check out the blog which has an overview of the release, download the Beta, and then watch the Android 11 video playlist. Sit back, relax, and learn about all of the new developer features in Android 11, Android Studio, Jetpack Compose, Hilt, Paging, System UI, Play Console, and more.


11 Weeks of Android

Image for post
Image for post

Because a mere fourteen videos is hardly enough to cover all of the details of what we’ve been working on for developers, we’ve launched a new series of content called 11 Weeks of Android. Each week will bring new content in specific areas, like UI, Jetpack, and Languages.

Week 1: People & Identity

Check out the blog for all of the details from last week, with links to videos, articles, and more.

Week 2: Machine Learning

This week is still in progress, with content like codelabs, screencasts, and information on the Android Developer Challenge winners. Stay tuned to Android Developers (#11WeeksOfAndroid) on Twitter to catch the content as it is posted, and check the Android Developers Blog at the end of the week for the summary and all of the links.

Next week: Privacy & Security

Image for post
Image for post

Android 11 Meetups

Image for post
Image for post

With the current pause on in-person events, it’s been great to see the developer community really lean into hosting online events, with speakers streaming presentations and participating in live Q&A. To help these efforts, and to get more information about Android 11 out to everyone that needs it, we worked with our GDG groups to create a series of events specifically around Android 11 and related content.

These events have already started (Murat Yener, Yigit Boyar, and I called into the first one of these in Istanbul, and Romain Guy, Murat, Yigit and I participated in the BlrDroid meetup in Bangalore last weekend), and will continue through the summer. They are happening all over the world all the time. This week alone, I’ll be participating in events in Berlin, Jakarta, London, and Kolachi.

I’ve never traveled so far so quickly with so little jetlag. And so few frequent flier miles!

Check out the Android 11 Meetups site to find one happening near you.


AndroidX

There were several AndroidX libraries released in the last couple of weeks (as usual). I won’t call out too many, as most of them are intermediate versions in the alpha, beta, and RC channels, but here are some of the notable exceptions.

Now in Alpha!

First, there was a veritable plethora of libraries hitting their alpha release. Check these out to see some of the new functionality we’re enabling in AndroidX.

Hilt: This is the first release of the new Hilt library for dependency injection on Android. It builds on top of Dagger and is the recommended way to do DI on Android.

Note that although the AndroidX version is 1.0.0-alpha01, this library comes from an internal version at Google that already ships with Dagger, which is why we recommend it if it works for you. However, being alpha, we expect APIs to shift a bit before it gets to beta, based on your feedback, so use and adopt as you see fit.

Also, be sure to check out the Hilt article mentioned way down below, as well as the code to the iosched app (discussed below), which now uses Hilt.

Paging 3.0.0: This is the first release of the total rewrite of the Paging library. It has been rewritten in Kotlin to take advantage of coroutines and Flow, though it also has support for RxJava and Guava ListenableFuture primitives, if you prefer these other approaches. Paging, which simplifies and optimizes handling data loading for RecyclerView, is all about asynchronous update, so these changes should make using Paging a lot more powerful and elegant.

Startup 1.0.0: The startup library was written to help speed up application launching, by simplifying and collecting startup tasks such as pooling use of a single ContentProvider, compared to the traditional approach of spawning many different ContentProviders (each of which comes with significant startup overhead).

Room 2.3.0: This version of Room is mainly about bugfixes, but also adds support for the new Paging 3 library (see above).

Benchmarking 1.1.0: This library makes it easier for you to test the performance of your code (listen to the ADB podcast episode #121 that we had with the team for more details on it). This latest release enables allocation metrics, integration with the Android Studio profiler tool, easier setup, and (of course) bug fixes.

Core 1.5.0: This release syncs with new APIs in Android 11, including ShortcutInfo, Notifications, and more.

Security Crypto 1.1.0: Among other changes, this library now supports releases back to API 21 (Android Lollipop).

Now in Stable!

Also, the following library just hit stable, so if that’s the milestone you were waiting for, this is your chance:

Fragment 1.2.5: This bugfix release just hit stable, with backports of some of the fixes going into the future 1.3.0 release.


Sample Code: IOSched

Image for post
Image for post

Every year, for Google I/O and the Android Developer Summit, the team continues development on the existing IOSched app, which serves two goals: providing a scheduling app for conference attendees and providing a rich, real-app environment in which to add the latest features and best development practices for sharing with the community.

This year, with the cancellation of Google I/O, only the latter purpose is served. But we carried on, recently finishing up work on the application. We added things like Kotlin coroutine support and usage of some of the new AndroidX libraries like benchmarking, ViewPager2, and Hilt, and have just published the code on GitHub.


Articles & Videos

Dependency Injection on Android with Hilt

Manuel Vivo posted an article on the new Hilt library for doing dependency injection on Android (see the above AndroidX section for more on Hilt. Or just go read this article).

What’s New in Jetpack

Florina Muntenescu posted this article, which is an extended version of Yigit Boyar’s video that was posted as part of the Android 11 playlist. The article gives an overview of recent libraries, including Hilt, Paging 3, Autofill, SeekableAnimatedVectorDrawable, using the Database Inspector in Android Studio for debugging Room apps, WindowManager, and MotionLayout. The article also talks about new capabilities in existing libraries, like… you know what, it’s probably easiest if you just go read the article to get this stuff first hand:

Debugging in Android Studio

David Herman from the Android Studio team posted an article with great debugging tips he gathered from his team:

I learned a lot from this piece, including:

  • Setting up filters for logcat so you see only the information you want to
  • Attaching the debugger to an app that’s already running (instead of restarting it with the debugger)
  • Several tips on breakpoints
  • Stacktrace analysis to help nail down which parts are coming from your code
  • … and much, much more! (Seriously — it’s a loooooong article with tons of tips)

There’s also a video version of this information if you prefer; the article is based on a presentation from the Android Developer Summit back in October of 2019:

System Trace

Yi Yang posted this article about recent improvements to the System Trace tool in Android Studio.

System Trace is Android Studio’s version of the systrace tool that we have used internally for years to analyze difficult performance problems. Systrace allows you to see detailed information about what all of the threads in your app are doing, as well as information about what else is happening in the system overall. system trace allows you to see this information directly in the IDE.

System Trace was created to enable a cleaner UI for systrace, to make it easier to both capture and visualize the results. One significant difference between these two versions of systrace is that systrace output is seen in the browser, whereas System Trace is integrated into Android Studio. Also, System Trace (the Studio version) only contains information on the app that you are debugging, not other processes running in the system (with the notable exception of some additional information from the SurfaceFlinger process, which works closely with your app’s rendering pipeline and is thus helpful in analyzing rendering performance problems). And System Trace uses Perfetto internally on API 28+, to take advantage of our latest instrumentation technology.

Reification

Murat Yener posted a video version of the article Reification of the Erased that I covered in Now in Android #19:


Docs

Jetpack

Image for post
Image for post

Jetpack has a new landing page, with information on Jetpack overall as well as some of the latest developments in this huge suite of libraries.


Modern Android Development

Image for post
Image for post

We’ve talked about Modern Android Development a few times over the past couple of years. but we thought it was time to more concretely define what we mean by that phrase (spoiler alert: it’s a subset of the APIs, tools, languages, and distribution mechanisms we offer that we believe all Android developers should adopt for creating the best Android applications). The new landing page covers more of the details, with helpful links to help you get started or (because many of you use many of these pieces already) to use even more of these pieces in your development life.


ADB Podcast Episodes

Image for post
Image for post

There’s been another episode of Android Developers Backstage posted since the last Now in Android. Check it out at the links below, or in your favorite podcast client:

ADB 142: Machine Learning Learning

In which Tor Norbye and I talked with Hoi Lam and Matej Pfajfar about machine learning on Android. Tune in to learn about ML Kit, TensorFlow Lite, transfer learning, federated learning, ML model binding, the Android Neural Networks API, and more!

ADB 141: Discussing Conversations

In which Tor Norbye, Romain Guy, and I talked with Julia Reynolds and Stefan Franks from the System UI team to have a discussion about Conversations, the new people-oriented feature in Android 11. Conversation notifications now appear in a dedicated space at the top of the notifications shade. Note that this feature works in conjunction with the Bubbles feature, which we also talked about recently, in Episode 140: Bubbles!.


Now then…

That’s it for this time. Go read about and download Android 11 Beta and watch all of the video presentations on developing for the latest Android features! Check out the 11 Weeks of Android site, including the new content from week 1 (People & Identity) and 2 (Machine Learning)! Tune into one of the many Android 11 Meetups happening all over the world! Download and play with the newest AndroidX libraries like Hilt and Paging3! Check out the source code for the IOSched sample app! Go take a look at new articles and videos on Hilt, Jetpack, Android Studio Debugging, System Trace, and Kotlin Reification! See the new landing pages for Jetpack and Modern Android Development! Listen to a podcast on Conversations! And come back here soon for the next update from the Android developer universe.

Android Developers

The official Android Developers publication on Medium