Luli Perkins, Developer Relations Program Manager
Our second edition of #AndroidDevJourney is here! At the beginning of this year we launched the #AndroidDevJourney to share the stories of members of our community through our social platforms. Each Saturday, from January through June, we’ll feature a new developer on our Twitter account.
For a chance to be featured in our March spotlight series, tweet us your story using #AndroidDevJourney.
Tell me about your journey to becoming an Android Developer and how you got started.
In 2012 I was working as a contractor for the NSW government here in Australia as a Java J2EE web developer. I'd been in that role for 11 years, building web apps for students and teachers. However, in 2012 the government decided that contractors were expensive and let us all go. So while in my hand-over period I'd read about some kids who were writing Android apps and making lots of money doing so. The Android Market was new and so any app uploaded got a large audience, and since I already knew Java it seemed like switching from a web developer to a mobile developer might be a smart career move. So I purchased a new phone, the HTC Legend and spent the next 2 weeks learning everything I could about Android apps. It was the first time I could run software I'd written on a device made by someone else that I could carry around with me. It was a very exciting time where any app idea seemed possible.
When my contract finally ended, I managed to get a new job working for a mobile development agency and started working on Android apps for their clients. In order to learn more about Android app development, I started to attend the local Android meetups and Google Developer Group events, listening to speakers (mostly from Google) and trying to improve my skills as an Android developer.
In 2013 I was offered the opportunity to become the organiser of the Sydney GDG and it was that year that I also attended my first Google I/O (I've been every year since). One of the hard parts about being a GDG organiser is finding speakers, so occasionally if there were no speakers, or if a speaker dropped out at the last minute, I would step in and give a talk instead. 2013 was also the year I decided to move on from the mobile agency I was working at, and I spent the next 5 years working as a freelance contractor, working with clients such as eBay, the Sydney Opera House, and one of the large banks in Australia. Being the organiser of GDG Sydney and a regular speaker at the meetups meant finding work was quite easy.
In 2016 because of all the speaking I was doing I was approached to join the Google Developer Experts program, at this time I was doing regular talks at both the GDG Sydney and Android meetup events every couple of months. When I joined the GDE program, I handed over my GDG responsibilities to some friends, who still run it to this day. As part of the GDE program I've been lucky enough to attend many Google I/O events, and I've also had the opportunity to speak at conferences all over the world, including DroidCon Boston, Mobile Era in Oslo, DevFest Melbourne, DroidCon Singapore, Chicago Roboto and many others. Having the chance to speak to so many people all over the world has been very rewarding, and I've made many friends.
In 2019 I joined the company where I work today - mx51, I'm the lead Android developer designing and building apps that run on payment terminals, which also integrate with Point of Sales systems. I'm still a GDE but with the 2020 madness the ability to speak at in-person events was severely hindered. I hope that in-person events will start again soon and that I can continue my journey as a GDE.
What’s one shortcut, tip, or hack you can’t live without?
Android development is constantly changing and advancing, so there is always something new to learn. My tip would be to always be learning, there are lots of ways to do this, subscribe to the Android Developers YouTube channels and Medium publications. Follow Googlers and Google Developer Experts on Twitter for new tips and posts. Subscribe to the Android Weekly newsletter for an overview of new libraries and blog posts, and attend your local GDG chapter and Meetups. Not only are these great ways to learn new aspects of Android development, but with meetups they're a great place to meet other Android developers, share successes, and ask for advice on problems.
What's the one piece of advice you wish someone would have given you when you started on your journey?
When I started out as an Android developer, I could never have dreamed about being a Google Developer Expert, travelling the world and speaking at large events. It took me a long time to learn that it's ok not to know the answers to people's questions. If at an event someone asks something you don't know, it's ok to say so. You can always say that you'll find out later and get back to them. There is no need to make up a wrong answer on the spot and lead someone off course. People are often scared that a topic they're presenting might not be the best or greatest way to do something, and they fear looking stupid. If a person in the audience suggests a better way that shouldn't be a worry, 1) you learnt something, 2) everyone else learnt something and 3) there may be scenarios where your solution is better and a discussion can be had. So my advice would be, when speaking don't fear questions but embrace the opportunity to help someone immediately, or later, or perhaps discover something new yourself.
I dabbled in Android development in college with the student mobile development group, but it wasn't until I was a few years in web development I made the real switch over. Back in my web dev days, I joined the Kotlin community, where I felt immediately welcome. Shortly after, I moved to Chicago a few years back when I heard there was a Kotlin community in the tech scene.
Getting up to speed with Android at a professional level is a whole different game, and I've been lucky to find the overlapping Kotlin/Android community both locally and globally. Android development has accelerated my career technically and professionally, yet the world is so deep and vast within the sandbox of Android development.
Already being an active enthusiast with Kotlin, it only felt natural to switch to Android, and I've never looked back. Since then, I've been working scalable and complex Android applications, and contributing with some technical writing along the way. I'm currently co-writing with my colleague, Pierre Laurence, on “Programming Android with Kotlin: Achieving Structured Concurrency with Coroutines with O'Reilly”, and I'm excited to have it come out sometime this year.
For larger projects, it's sometimes hard to locate the file you're looking at in your Project view. You can use the target symbol ⊕ to get a highlight the file you're currently on in Android Studio.
Only install LeakCanary when, and only when, you and your team is ready for that conversation 😁
My journey as a developer started as a child. As a kid, I was obsessed with robots. I remember my dad bought me a Lego set called Lego Mindstorm, which was basically a robotics set with sensors and motors, plus it was also programmable. After graduating high school, I enrolled in the US Army as an Aviation Maintenance Repairer. After 6 years, I was honorably discharged then enrolled in college at Fordham University. In 2014, I received a Bachelor of Science in Computer Science. About 2 years later, I met my now wife, and together we started building EatOkra as a way for us to find black-owned restaurants in Brooklyn, NY. As we introduced the application to new people, they shared it with their network; before we knew it, many people were asking us to cover more areas in the south.
Learn how to ask the right questions.
One piece of advice I wish I took more seriously was to not build an application using beta technology. EatOkra's MVP was created using a beta version of a software framework. It started out good but then as they made updates, at times, I ended up having to wait months for certain issues to get fixed. I also had to completely stop and restart the app with an entirely new code base because the company decided to change how they architected the code. I learned a lot but it was painful to navigate.
My journey started a couple of years ago (I was still in college) when I saw the Android Developer Udacity course. There was no nano degree back in the day. So once I saw it, I started building some apps for myself. From there, I applied for my first job as a junior developer in a big consulting firm. Then I started seeing more courses and started following a lot of people at Twitter, like Sam Edwards and Joe Birch (both GDE). The community made me grow and learn. A couple of years later I got my first team and I began delivering speeches at conferences and keeping up my Medium blog on the side. The community offers me feedback and knowledge, and especially a place to learn. My first conference was with WomenWhoCode.org here in Mexico. They opened a place for me without any experience. The same happened with Google Developers Groups here in Mexico City.
I became a Lead Engineer during my second job and I began doing worldwide conferences. I asked for feedback from Sam Edwards and Carlos Muñoz (also GDEs in Colombia) and they told me not to worry because I would amazingly and they encouraged me to keep doing it.
I got a really nice offer to start from scratch here as a Mobile Platform engineer in Mexico City with a huge fintech Startup (Konfio.mx). This is my current job, which means I am in the architectural office where we choose new ideas and new processes and pretty much service all the areas in the company.
I started creating a group of series to teach people some specific topics that I noticed were not deeply addressed. I also started getting involved in Kotlin Multiplatform and then I was reached out to by two GDE that nominated me to become GDE, Walmyr Carvalho, and Sam Edwards. They offered me feedback about my latest talks, podcast, and series and I was accepted at the end of 2020. Right now, I'm trying to learn more and deliver more talks and blog posts to the community.
My special hack as an Android Developer is to use Wireless Debugging in the lastest Android Studio for physical devices. It is my favorite part because I don't need to use any cables and the setup is super easy!
My advice is that learning is a process, things change and all of this must be welcome because we are addressing the evolution of the platform as we code. Also, read everything you can because people in the community are amazing and they love to teach! Open an account on Twitter, because there are a lot of people giving tips in less than 180 characters.
The Android Developer community prides itself in its inclusivity and welcomes developers from all backgrounds and stages of life. If you’re feeling inspired and want to learn more about how to become a part of our community, here are a few resources to help get you started.
Dive into developer.android.com
Follow us on Twitter
Subscribe to our YouTube channel
The Google Developer Groups program gives developers the opportunity to meet local developers with similar interests in technology. A GDG meetup event includes talks on a wide range of technical topics where you can learn new skills through hands-on workshops.
Join a chapter near you here.
Founded in 2014, Google’s Women Techmakers is dedicated to helping all women thrive in tech through community, visibility and resources. With a member base of over 100,000 women developers, we’re working with communities across the globe to build a world where all women can thrive in tech.
Become a member here.
The Google Developers Experts program is a global network of highly experienced technology experts, influencers and thought leaders who actively support developers, companies and tech communities by speaking at events, publishing content, and building innovative apps. Experts actively contribute to and support the developer and startup ecosystems around the world, helping them build and launch highly innovative apps.
Learn more about the program here.
Java is a registered trademark of Oracle and/or its affiliates.
Posted by Nick Grayson, Product Manager
Android works best when it helps developers create apps that people love. That’s why we are dedicated to providing useful APIs like Activity Recognition which, with the user’s permission, can detect user’s activities (such as whether a user is biking or walking) to help apps provide contextually aware experiences.
So much of what we do relies on a good night's rest. Our phones have become great tools for making more informed decisions about our sleep. And by being informed about sleep habits, people can make better decisions throughout the day about sleep, which affects things like concentration and mental health.
In an effort to help our users stay informed about their sleep, we are making our Sleep API publicly available.
The Sleep API is an Android Activity Recognition API that surfaces information about the user’s sleep. It can be used to power features like the Bedtime mode in Clock.
This sleeping information is reported in two ways:
The API uses an on-device artificial intelligence model that uses the device’s light and motion sensors as inputs.
As with all of our Activity Recognition APIs, the app must be granted the Physical Activity Recognition runtime permission from the user to detect sleep.
Developers spend valuable engineering time to combine sensor signals to determine when the user has started or ended activities like sleep. These detection algorithms are inconsistent between apps and when multiple apps independently and continuously check for changes in user activity, battery life suffers.
The Sleep API is a simple API that centralizes sleep detection processing in a battery-efficient manner. For this launch, we are proud to collaborate with Urbandroid, the developer of the popular alarm app, Sleep As Android
Sleep as Android is a swiss army knife for getting a better night’s rest. It tracks sleep duration, regularity, phases, snoring, and more. Sleep Duration is one of the most important parameters to watch for ensuring a good night’s rest. The new Sleep API gives us a fantastic opportunity to track it automatically in the most battery efficient way imaginable. - Sleep as Android Team
- Sleep as Android Team
The Sleep API is available for developers to use now as part of the latest version of Google Play Services.
This API is one step of our efforts to help our users get a better night's rest. We look forward to working more on this API and in this area in the future.
If you are interested in exploring or using this API, check out our API Documentation.
Posted by Erica Hanson, Global Program Manager, Google Developer Student Clubs
Google Developer Student Clubs, a program of university based community groups for students interested in Google developer technologies, recently started hosting study groups called Android Study Jams. The goal? Learn Android app development through hands-on codelabs in an online curriculum provided by Google. There are two tracks: one for students who are new to programming, and one for those who already have experience. Interested in participating? Facilitator materials are available for anyone to host Android Study Jams in their community - take a look and get to building.
Google Developer Student Clubs are dedicated to helping students learn programming together, among peers, in a fun and interactive setting. While over 50 thousand students from all over the world have participated in these Android workshops, we wanted to highlight the exciting work from groups in Indonesia, Turkey, and Nigeria. From programming in Kotlin to building a series of apps, these students have put their minds to work.
Learn more about what these three clubs have been up to below.
Indonesia
(Image from UNPNVJ’s Android Study Jams where students are learning Kotlin)
Club members from Universitas Pembangunan Nasional Veteran Jakarta in Indonesia recently came together to host a virtual Android Study Jams session with over 60 students to learn the basics of building Android apps. Their student-run learning session covered several topics, including:
After the students felt comfortable with the basics of Kotlin and Android Studio, they combined their new skills to create their own layouts for a birthday card app.
(Image of Birthday cake app)
We can’t wait to see what the students from UPNVJ build next on Android thanks to their new programming skills.
Turkey
(Image from Medipol University where Nelson Glauber is teaching students the basics of Android App Development)
Medipol University in Turkey also hosted their own Android Study Jams by organizing a livestream with over 500 participants. Nelson Glauber, who was the first Google Developer Expert for Android in Latin America, led the event and helped students learn more about topics like:
After taking students’ questions, Nelson worked with them to build an interactive dice roller app that updates the screen after the results of a roll.
(Image of Dice Roller app)
Nigeria
The Google Developer Student Club at Kaduna State University in Nigeria tackled different codelabs and learning pathways in their Android Study Jams. In particular, the group worked on the following topics:
With these new skills, the group is now able to start working on building more advanced apps that allow users to navigate between multiple screens.
(Gif of Cupcake app)
How to join a Google Developer Student Club and Android Study Jams
If you’re a university student looking to learn more about programming alongside a community of your peers, sign up for a Google Developer Student Club near you here. As a part of the community, you’ll have access to special learning opportunities, including Android Study Jams, on many of Google’s developer products.
If you want to lead your own Android Study Jams or explore other free resources for learning Android development, click here.
Posted by Anna-Chiara Bellini, Product Manager, Nick Butcher, Developer Relations
Today, we’re launching the beta release of Jetpack Compose, our new 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 beautiful, responsive apps with way less code. Built to integrate with existing Android apps and Jetpack libraries, you can adopt Compose at your own pace by combining Android Views and Compose.
With this beta release, Compose is API complete and has all the features you need to build production-ready apps. Beta also means API stable, so we won’t change or remove APIs. Now is a great time to start learning Compose and begin planning for how you will use it in an upcoming project or feature once it reaches 1.0 later this year.
Our team has been developing Compose in the open with feedback and participation from the community. Since open sourcing development in 2019, we’ve had 30 public releases, addressed over 700 external bugs, and accepted over 200 external contributions. We love seeing what you’ve been building with Compose and have used your feedback and feature requests to refine our APIs and prioritize our work. Since the alpha release, we’ve added and improved a number of new features:
For the beta release, we’ve been focused on ensuring API completeness; that all foundational APIs are in place for us to continue to build upon for 1.0 and beyond. We’ll work on stabilizing these APIs up to our 1.0 release with particular focus on app performance and accessibility.
Compose Beta is supported by the latest Canary of Android Studio Arctic Fox, which features many new tools:
🆕 Animation Preview: inspect and playback animations
🆕 Compose support in the Layout Inspector
🆕 Interactive preview: inspect and interact with a Composable in isolation
🆕 Deploy Preview: to deploy a Composable on your device without needing a full app
Live Literals on Android Emulator
Layout Inspector for Jetpack Compose
Jetpack Compose is designed to work seamlessly with Android Views, letting you adopt at your own pace. You can embed Compose UIs within Android Views and use Views within Compose. We lay out a number of adoption strategies in our interoperability documentation.
In addition to View interop, we integrate with common libraries to help you to add Compose to your existing applications—no need to rewrite or re-architect your app. We offer integrations with:
The MDC-Android Compose Theme Adapter and Accompanist libraries provide integrations with Material and AppCompat XML themes so you don’t need to duplicate theme definitions. Accompanist also offers wrappers for common image loading libraries.
Jetpack Compose is a declarative UI toolkit, a paradigm shift from the current View system, where you describe what your UI should look like for a given application state, not how to produce it. Compose takes care of updating your UI when your app state changes, so you don’t have to manipulate your UI into the desired state which can be tedious and error prone.
Built entirely in Kotlin, Compose takes advantage of its great language features to offer powerful, succinct, intuitive APIs. Coroutines for example enable us to write much simpler async APIs such as describing gestures, animation or scrolling. This makes it easier to write code that combines async events, like a gesture which hands off to an animation, all with cancellation and clean-up provided by structured concurrency.
To help you and your team learn all about Jetpack Compose, we’ve updated our learning pathway; a curated list of videos, hands-on codelabs and key docs to get you started. Today we’re releasing new & updated documentation guides, a number of screencasts and a new Animation Codelab to help dive deeper into how to build with Compose. From guidance on architecture, accessibility and testing, to deep dives into animation, lists or thinking in Compose, we have guides to help you get up to speed.
We also offer 8 official sample applications if you want to jump straight in and see Compose in action. We have simple to complex samples, each showcasing different APIs and use cases. Check the readme for more details.
If you’re ready to get started with Compose–and also want to win some prizes along the way, check out the #AndroidDevChallenge. For the next four weeks, we’ll have weekly challenges designed to give your very own insights into Jetpack Compose, so you can fly through your projects. Compete to win new prizes for each challenge, with over one thousand prizes to win including a Google Pixel 5. You can read more about the first weekly challenge - starting today - right here.
With Jetpack Compose reaching Beta—with stable APIs and feature complete for 1.0—it's a great time to start learning Jetpack Compose and planning how you might use it in an upcoming project. We’d love to hear your feedback on adopting Compose in your app or join the discussion in the Kotlin Slack #compose channel.
Posted by The Jetpack Compose Team
Jetpack Compose is Android’s modern toolkit for building native UI. It enables you to quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs. With the Beta of Jetpack Compose released today, this is the perfect time to learn Compose and get ready to adopt it. To help you get started with Jetpack Compose we are launching a new #AndroidDevChallenge!
For the next four weeks, the #AndroidDevChallenge will be launching a series of weekly challenges to help you build better apps faster with Jetpack Compose. Oriented around “lift off insights," each challenge focuses on a new area of Compose, from animations to Material Theming, composables to lists and more! Compete to win new prizes for each challenge, with over one thousand prizes to win including a Pixel 5. 1 The first challenge starts today!
Every week brings a new challenge with its own rules and tasks. Every Wednesday starting today we’ll publish a blog post containing the full description of what you need to do and how long you have to complete the task. Each challenge will help you get familiar with the compose mental model and different Compose APIs - from basic Composables like Text and List, to state, animations and more.
Text
List,
Your solution to each challenge must be implemented in a GitHub repository. Make a copy of this Github repository template and follow the instructions in the README. The template contains a basic Hello World! in Compose and a continuous integration setup.
Hello World!
Let’s start the #AndroidDevChallenge with a bang bark: build a puppy adoption app! The app should contain an overview screen that displays a list of puppies, and a detail screen showing each puppy's details. You have until March 2nd, 23:59 PST to submit your entry. 2
Your UI must be fully built in Compose. Your submission will only be judged based on your app’s UI layer. To help you with the implementation, check out the Compose documentation on layouts, lists, text and navigation. For some paws-on learning try out the Compose pathway, with codelabs covering several topics useful in completing this challenge.
Are you a 🐱rather than a 🐶 person? Submissions for any type of pet adoption app are welcomed.
We look forward to seeing what you build!
Our first challenge kicks off with a prize that makes for the perfect sidekick as you’re flying through Compose: a limited edition trophy of our Jetpack Compose superhero, made of LEGO bricks. The first 500 people to successfully complete this challenge and submit their entry can add this trophy to their collection of Android figurines, showing off how you’re a winner for the first week’s #AndroidDevChallenge.
Week #1 prize: Jetpack Compose superhero
Community is at the heart of Jetpack Compose and your feedback helps us build a better product:
In less than 24 hours, we're giving you a backstage pass to Jetpack Compose, Android's modern toolkit for building native UIs, on #TheAndroidShow. Hosted by Kari Byron, you'll hear the latest on Jetpack Compose from the people who built it, plus a fireside interview with Android's Dave Burke.
Broadcasting live on February 24th at 9AM PT, you’ll be able to watch the show at goo.gle/TheAndroidShow, where you’ll also be able to find more information and links to all of the things we covered in the show. Or if you prefer, you can watch directly on YouTube or Twitter.
Got a burning Jetpack Compose question? Want to learn about annotating a function type with @ Composable? Or how to add a static parameter to Composable functions at the compiler level? Tweet us your Jetpack Compose questions now, using #TheAndroidShow. We’ve assembled a team of experts, ready to answer your questions live on #TheAndroidShow; tune in on February 24 to see if we cover your question!
Posted by Chet Haase, Developer Relations Engineer
We recently finished another series of MAD Skills videos - this time on Motion Layout. We covered ways in which you can use the API and the design tool to create rich, custom, and complex animations for your users.
Check out the episodes below to increase your knowledge and skills in different areas of the Motion Layout API and design tool. And watch the live Q&A episode, featuring engineers on the Motion Layout and Developer Relations teams.
This video explores how ConstraintSets are used to define different states of your UI that you animate between. Along the way, Sean shows how to use Motion Editor in Android Studio to create and edit these transitions.
This episode shows how to use Keyframes in a MotionLayout animation to customize the animation by altering the values of various properties over time. For example, you can use keyframes to change the path an object takes between start and end, instead of following just the default linear path it would follow otherwise.
In this third episode, Sean shows how you can add ConstraintSets, beyond the default two (start + end) to create more complex animations, or transitions that flow through multiple states between the start and end.
In the fourth episode, explains how to build a collapsible toolbar using Motion Layout, which is a common place where this API shines. Along the way, you'll learn how to animate custom attributes using MotionLayout.
The final episode of the series was a live Q&A, streamed and recorded on February 18th. It’s too late to see it or ask your questions live, but check out the recording to watch the conversation between me (asking the Qs) and Sean, John, and Nicolas (supplying the As).
There are plenty of other resources to learn more about how to use Motion Layout, besides this MAD Skills series, including:
The Motion Layout series may have ended, but there’s still plenty still to come in the MAD Skills series. Be sure to check the MAD Skills playlist on YouTube, the articles on Medium, or this handy landing page that points to all of it.
Posted by Dave Burke, VP of Engineering
Every day, Android apps help billions of people work, play, communicate, and create on a wide range of devices from phones and laptops to tablets, TVs, and cars. As more people come to rely on the experiences you build, their expectations can rise just as fast. It’s one of the reasons we share Android releases with you early: your feedback helps us build a better platform for your apps and all of the people who use them. Today, we’re releasing the first Developer Preview of Android 12, the next version of Android, for your testing and feedback.
With each version, we’re working to make the OS smarter, easier to use, and better performing, with privacy and security at the core. In Android 12 we’re also working to give you new tools for building great experiences for users. Starting with things like compatible media transcoding, which helps your app to work with the latest video formats if you don’t already support them, and easier copy/paste of rich content into your apps, like images and videos. We’re also adding privacy protections and optimizing performance to keep your apps responsive.
Today’s first preview is just the start for Android 12, and we’ll have lots more to share as we move through the release. Read on for a taste of what’s new in Android 12, and visit the Android 12 developer site for details on downloads for Pixel and release timeline. As always, it’s crucial to get your feedback early, to help us incorporate it into the final product, so let us know what you think!
Alongside the work we’re doing in Android 12, later this month we’ll have more to share on another important tool that helps you create great user experiences more easily: Jetpack Compose, our modern toolkit for building native UI. Join us on #TheAndroidShow for a behind-the-scenes look at Jetpack Compose, livestreamed on February 24 at 9AM PT, and tweet your Jetpack Compose questions using #TheAndroidShow to have them answered live on the show.
Privacy is at the heart of everything we do, and in Android 12 we’re continuing to focus on giving users more transparency and control while keeping their devices and data secure. In today’s release we’ve added new controls over identifiers that can be used for tracking, safer defaults for app components, and more. These changes may affect your apps, so we recommend testing as soon as possible. Watch for more privacy and security features coming in later preview releases.
Modern SameSite cookie behaviors in WebView - In line with changes to Chrome and other browsers, WebView includes new SameSite cookie behaviors to provide additional security and privacy and give users more transparency and control over how cookies can be used across sites. More here.
Safer exporting of components - To prevent apps from inadvertently exporting activities, services, and receivers, we’re changing the default handling of the android:exported attribute to be more explicit. With this change, components that declare one or more intent filters must now explicitly declare an android:exported attribute. You should inspect your components in the manifest in order to avoid installation errors related to this change. More here.
Safer handling of Intents - To make handling PendingIntents more secure, Android 12 requires apps to explicitly declare a mutability flag, either FLAG_MUTABLE or the new FLAG_IMMUTABLE, for each PendingIntent. More here.
You can read more about these and other privacy and security changes here.
In Android 12 we’re investing in key areas to help deliver a polished experience and better performance for users. Here are some of the updates so far.
Compatible media transcoding - With the prevalence of HEVC hardware encoders on mobile devices, camera apps are increasingly capturing in HEVC format, which offers significant improvements in quality and compression over older codecs. Most apps should support HEVC, but for apps that can’t, we’re introducing compatible media transcoding.
With this feature, an app that doesn’t support HEVC can have the platform automatically transcode the file into AVC, a format that is widely compatible. The transcoding process takes time, depending on the video and hardware properties of the device. As an example, a one minute 1080p video at 30fps takes around 9 seconds to transcode on a Pixel 4. You can opt-in to use the transcoding service by just declaring the media formats that your apps don't support. For developers, we strongly recommend that your apps support HEVC, and if that’s not possible, enable compatible media transcoding. The feature will be active on all devices using HEVC format for video capture. We'd love to hear your feedback on this feature. More here.
AVIF image support - To give you higher image quality with more efficient compression, Android 12 introduces platform support for AV1 Image File Format (AVIF). AVIF is a container format for images and sequences of images encoded using AV1. Like other modern image formats, AVIF takes advantage of the intra-frame encoded content from video compression. This dramatically improves image quality for the same file size when compared to older image formats, such as JPEG.
AVIF (18.2kB)
JPEG (20.7kB)
Credit: Image comparison from AVIF has landed by Jake Archibald
Foreground service optimizations - Foreground services are an important way for apps to manage certain types of user-facing tasks, but when overused they can affect performance and even lead to app kills. To ensure a better experience for users, we will be blocking foreground service starts from the background for apps that are targeting the new platform. To make it easier to transition away from this pattern, we’re introducing a new expedited job in JobScheduler that gets elevated process priority, network access, and runs immediately regardless of power constraints like Battery Saver or Doze. For back-compatibility, we’ve also built expedited jobs into the latest release of Jetpack WorkManager library. Also, to reduce distraction for users, we’re now delaying the display of some foreground service notifications by up to 10 seconds. This gives short-lived tasks a chance to complete before their notifications are shown. More here.
Rich content insertion - Users love images, videos and other expressive content, but inserting and moving this content in apps is not always easy. To make it simple for your apps to receive rich content, we’re introducing a new unified API that lets you accept content from any source: clipboard, keyboard, or drag and drop. You can attach a new interface, OnReceiveContentListener, to UI components and get a callback when content is inserted through any mechanism. This callback becomes the single place for your code to handle insertion of all content, from plain and styled text to markup, images, videos, audio files, and more. For back-compatibility, we’ve added the unified API to AndroidX. More here.
Audio-coupled haptic effect - In Android 12 apps can provide audio-coupled haptic feedback through the phone's vibrator. The vibration strength and frequency are derived from an audio session, allowing you to create more immersive game and audio experiences. For example, a video calling app could use custom ringtones to identify the caller through haptic feedback, or you could simulate rough terrain in a racing game. More here.
Notification UI updates - We’re refreshing notification designs to make them more modern, easier to use, and more functional. In this first preview you’ll notice changes from the drawer and controls to the templates themselves. We’re also optimizing transitions and animations across the system to make them more smooth. As part of the updates, for apps targeting Android 12 we’re decorating notifications with custom content with icon and expand affordances to match all other notifications. More here.
Faster, more responsive notifications - When users tap a notification, they expect to jump immediately into the app - the faster the better. To meet that expectation, developers should make sure that notification taps trigger Activity starts directly, rather than using “trampolines” - an intermediary broadcast receiver or service - to start the Activity. Notification trampolines can cause significant delays and affect the user experience. To keep notifications responsive, Android 12 will block notification trampolines by preventing them from launching their target Activities, and we’re asking developers to migrate away from this pattern. The change applies only to apps targeting the new platform, but for all apps we’ll display a toast to make trampolines visible to you and to users. More here.
Improved Binder IPC calls - As part of our work on performance, we’ve put a focus on reducing system variability. We’ve taken a look at latency and workload distribution, and made optimizations that reduce the median experience from the tail end, or 99% percentile use case. In doing so, we’ve targeted improvements to system binder calls adding lightweight caching strategies and focusing on removing lock contention to improve latency distribution. This has yielded roughly a 2x performance increase on Binder calls overall, with significant improvements in specific calls, for example a 47x improvement in refContentProvider(), 15x in releaseWakeLock(), and 7.9x in JobScheduler.schedule().
refContentProvider()
releaseWakeLock()
JobScheduler.schedule()
We’re working to make updates faster and smoother by prioritizing app compatibility as we roll out new platform versions. In Android 12 we’ve made most app-facing changes opt-in to give you more time, and we’ve updated our tools and processes to help you get ready sooner. We’ve also added new functionality to Google Play system updates to give your apps a better environment on Android 12 devices.
More of Android updated through Google Play - We’re continuing to expand our investment in Google Play system updates (Project Mainline) to give apps a more consistent, secure environment across devices. In Android 12 we’ve added the Android Runtime (ART) module that lets us push updates to the core runtime and libraries on devices running Android 12. We can improve runtime performance and correctness, manage memory more efficiently, and make Kotlin operations faster - all without requiring a full system update. We’ve also expanded the functionality of existing modules - for example, we’re delivering our compatible media transcoding feature inside an updatable module.
Optimizing for tablets, foldables, and TVs - With more people than ever using apps on large-screen devices like foldables, tablets, and TVs, now is a great time to make sure your app or game is ready. Get started by optimizing for tablets and building apps for foldables. And, for the biggest screen in the home, the first Android 12 preview for Android TV is also available. In addition to bringing the latest Android features to the TV with this preview, you will also be able to test your apps on the all-new Google TV experience. Learn more on the Android TV Developers site and get started with your ADT-3 developer kit.
Updated lists of non-SDK interfaces - We’ve restricted additional non-SDK interfaces, and as always your feedback and requests for public API equivalents are welcome.
Easier testing and debugging of changes - To make it easier for you to test the opt-in changes that can affect your app, we’ve made many of them toggleable. WIth the toggles you can force-enable or disable the changes individually from Developer options or adb. Check out the details here.
App compatibility toggles in Developer Options.
Platform stability milestone - Like last year, we’re letting you know our Platform Stability milestone well in advance, to give you more time to plan for app compatibility work. At this milestone we’ll deliver not only final SDK/NDK APIs, but also final internal APIs and app-facing system behaviors. We’re expecting to reach Platform Stability by August 2021, and you’ll have several weeks before the official release to do your final testing. The release timeline details are here.
The Developer Preview has everything you need to try the Android 12 features, test your apps, and give us feedback. You can get started today by flashing a device system image to a Pixel 3 / 3 XL, Pixel 3a / 3a XL, Pixel 4 / 4 XL, Pixel 4a / 4a 5G, or Pixel 5 device. If you don’t have a Pixel device, you can use the 64-bit system images with the Android Emulator in Android Studio.
When you’re set up, here are some of the things you should do:
We’ll update the preview system images and SDK regularly throughout the Android 12 release cycle. This initial preview release is for developers only and not intended for daily or consumer use, so we're making it available by manual download only. You can flash a factory image to your Pixel device, or you can sideload an OTA image to a Pixel device running Android 11, in which case you won’t need to unlock your bootloader or wipe data. Either way, once you’ve manually installed a preview build, you’ll automatically get future updates over-the-air for all later previews and Betas. More here.
As we get closer to a final product, we'll be inviting consumers to try it out as well, and we'll open up enrollments through Android Beta at that time. Stay tuned for details, but for now please note that Android Beta is not currently available for Android 12.
For complete information, visit the Android 12 developer site.
Posted by Hoi Lam, Android App Quality
Since the launch of Android more than 10 years ago, the platform and the user’s expectations have grown. There are improvements from user experience through material design to the importance and advancement in privacy. We know you want your apps to offer a great user experience. At the same time, we also know that it’s not always straightforward to know which area to tackle first. That’s why we are launching a new App Quality section in our developer site to help you keep up-to-date with key aspects of app quality and provide related resources.
In the first release, we have updated the Core App Quality checklist to take into account recent Android releases as well as the current trends of the app ecosystem. Here are some highlights in this update:
Going forward, we aim to update this list on a quarterly basis to make sure this is up-to-date. In addition, we will be updating the quality checklists for other form factors.
We are working on additional tools and best practices to make it easier for you to build quality applications on Android. We can’t wait to introduce these new improvements to you. Stay tuned!
Posted by Ting-Yuan Huang, Software Engineer and David Winer, Product Manager
Today we are excited to announce the alpha of Kotlin Symbol Processing (KSP), an all-new tool for building lightweight compiler plugins in Kotlin. KSP offers similar functionality to KAPT, however it’s up to 2x faster, offers direct access to Kotlin compiler features, and is being developed with multiplatform compatibility in mind.
KSP is compatible with the Kotlin 1.4.30 release and onwards. You can check out the open source code and documentation in the KSP GitHub repository.
The #1 request we hear from Kotlin developers is to make build speeds faster. Many developers iterate on and deploy apps dozens of times a day, so having to sit around waiting for a slow build can be very time consuming. One of the biggest challenges with compiling Kotlin code is that Kotlin doesn’t have a native annotation processing system. Annotation processors like Room are ubiquitous on Android and rely on Java annotation processing compatibility through the Kotlin Annotation Processing Tool (KAPT). KAPT can be slow to run, though, since it requires generating intermediate Java stubs that can then be ingested by the Java annotation processing system.
When designing KSP, we thought about what annotation processing would look like for Kotlin if we built it from the ground up. KSP offers a powerful and yet simple API for parsing Kotlin code directly, dramatically reducing the build speed tax imposed by KAPT’s stub generation. Indeed, initial benchmarks with the Room library show that KSP is approximately 2x faster than KAPT.
To see what KSP looks like in action, download the KSP playground project from GitHub. In it you’ll find:
test-processor
workload
All of the logic for implementing the builder is in test-processor — for the consumer (workload), the only difference between using KAPT and KSP is a two-line build file change:
This is the goal of KSP: most Android app developers don’t need to worry about its internals; other than this one line change, a library that supports KSP looks just like a normal annotation processor, only it’s up to 2x faster. That said, using KAPT and KSP in the same module will likely slow down your build initially, so during this alpha period, it is best to use KSP and KAPT in separate modules.
As more annotation processors adopt KSP, we expect most of your modules to be able to use KSP as a near drop-in replacement for KAPT. For now, you can check out which annotation processors offer KSP support in this table. If a library that supports or is implementing support for KSP is missing from the table, please submit a pull request with your suggestion!
If you are an author of a library that currently uses annotation processing, you can find more information on how to make your library compatible with KSP in the quickstart and README guides.
For library authors, now that KSP is in alpha, it’s a great time to start looking closely at it and giving us feedback on the API in the KSP issue tracker. In addition, we regularly post release updates in the #ksp channel on Kotlin Slack. Since the developer preview last June, we’ve closed over 100 bugs and issues, dozens of which have been reported by the amazing community of Kotlin library developers.
Posted by Kat Kuan, Developer Advocate, Android
We strive to make Android development content accessible to all, so that anyone can become an Android developer. Over the years, millions of students at all different levels have consumed our learning content and worked through courses and codelabs to advance their skills. We continue to update and release new content as the ever-changing industry continues to evolve.
As demand for skilled Android developers increases in the job marketplace, there is an even greater need for educators to train the next generation of Android developers. That is why we created these resources to help support and empower educators.
New Android Development with Kotlin instructor-led curriculum
Today we’re announcing the launch of our new instructor-led curriculum for Android Development with Kotlin. This is for classroom learning (virtual or in-person) with an instructor delivering lectures on important Android concepts, and students receiving hands-on practice through codelabs. The official course materials are now available and can be freely modified by instructors to adapt to their students’ needs.
This is a major update to the curriculum we released in 2018. The updates account for the most recent changes in the Android platform, from the release of the Android Jetpack libraries to Android development becoming Kotlin-first. The Kotlin programming language helps developers become more productive with more concise syntax and improved code safety. Over 60% of professional Android developers already use Kotlin, and it’s Google’s recommended programming language for new developers building Android apps. While instructors do not need Android or Kotlin experience to teach the curriculum, prior programming experience is recommended.
We’ve partnered with universities and skilling partners in India such as Shivaji University, I. K. Gujral Punjab Technical University, Chandigarh University, Ganpat University, Telangana Academy for Skill and Knowledge (TASK), and Information and Communication Technology Academy of Kerala, who will be some of the first to offer this curriculum to their students in the Spring, with more universities to follow in the Fall and coming semesters. With the curriculum now available publicly, educators are welcome to start teaching Android development.
“As it’s mostly a hands-on course, students learn implementations which helps them in their placements in Mobile app companies.” -Dr. Kavita S. Oza, Shivaji University
Android Study Jams content now available for all developers
Outside a formal classroom, learning in a peer group has also been shown as an effective way to learn Android. That is why we’re also making the Android Study Jams program available to all developers today. Android Study Jams enables a group of people to come together and learn Android development through hands-on codelabs in an online curriculum. An instructor is not needed to deliver lectures, but it is recommended to have a facilitator to organize the group meetings. No programming experience is needed to get started. Over 38,000 students in Google Developer Student Clubs around the globe have already participated in this program.
“Introducing people to Kotlin and being by their side at this first step which could touch their lives created great happiness and excitement for us.” - Ceren Tunay and Serkan Alc, Developer Student Club Turkey
With many paths to learning, it is always interesting to see the different journeys of students who become Android developers, and exciting to see the resulting personal success, innovative apps, and entrepreneurial pursuits they have. The following video highlights two developers and how learning Android development has shaped their careers.
For more details on these new offerings, check out the Android Development Resources for Educators.
For independent learners, we also offer self-paced learning content, Udacity courses and Nanodegrees, YouTube videos, and more resources on developer.android.com. Keep us posted on how your learning journey goes!