Tag Archives: Android app development

Introducing the new Google Pay button view on Android

Posted by Jose Ugia – Developer Relations Engineer

The Google Pay button is your customer’s entry point to a swift and familiar checkout with Google Pay. Here are some updates we are bringing to the button to make it easier for you to use it and customize it based on your checkout design, while creating a more consistent and informative experience to help your customers fly through your checkout flows more easily.


A new look and enhanced customization capabilities

Previously, you told us about the importance of a consistent checkout experience for your business. We gave the Google Pay button a fresh new look, applying the latest Material 3 design principles. The new Google Pay button comes in two versions that make it look great on dark and light themed applications. We have also added a subtle stroke that makes the button stand out in low contrast interfaces. In addition, we are introducing new customization capabilities that make it easy to adjust the button shape and corner roundness and help you create more consistent checkout experiences.

image of the updated Pay with Google Pay button annotating the subtle stroke and adjustable rounded corners
Figure 1: The new Google Pay button view for Android can be customized to make it more consistent with your checkout experience.

A new button view for Android

We also improved the Google Pay API for Android, introducing a new button view that simplifies the integration. Now, you can configure the Google Pay button in a more familiar way and add it directly to your XML layout. You can also configure the button programmatically if you prefer. This view lets you configure properties like the button theme and corner radius, and includes graphics and translations so you don't have to download and configure them manually. Simply add the view to your interface, adjust it and that's it.

The new button API is available today in beta. Check out the updated tutorial for Android to start using the new button view.

image of an example implementation showing how you can add and configure the new button view directly to your XML layout on Android
Figure 2: An example implementation of how you can add and configure the new button view directly to your XML layout on Android.

Giving additional context to customers with cards’ last 4 digits

Earlier, we introduced the dynamic Google Pay button for Web, which previewed the card network and last four digits for the customer’s last used form of payment directly on the button. Since then, we have seen great results, with this additional context driving conversion improvements and increases of up to 40% in the number of transactions.

Later this quarter, you’ll be able to configure the new button view for Android to show your users additional information about the last card they used to complete a payment with Google Pay. We are also working to offer the Google Pay button as a UI element in Jetpack Compose, to help you build your UIs more rapidly using intuitive Kotlin APIs.

image showing an example of how the dynamic version of the new Google Pay button view will look on Android.
Figure 3: An example of how the dynamic version of the new Google Pay button view will look on Android.

Next steps

Check out the documentation to start using the new Google Pay button view on Android. Also, check out our own button integration in the sample open source application in GitHub.

Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

Posted by the Android team

In 2020, the Mercari team took on a big initiative to update its app’s technical infrastructure. At the time, its codebase was seven years old and hadn’t undergone any major architectural updates. This affected the team’s ability to develop new features and release timely app updates. To resolve this technical debt, Mercari launched what it called the GroundUP initiative—a complete rewrite of its application across platforms, including Android.

The goal was to create a completely modernized application with a scalable design. While retooling the app, Mercari developers turned to Jetpack Compose, Android’s modern declarative toolkit for creating native UI. During the evaluation, the team learned rewriting in Jetpack Compose would help clean up their codebase and have more control over how the app looks.

A rewrite with less code

The Mercari team completely rewrote the architecture and tech stack for its Android app using Jetpack Compose. Mercari developers created a new design system and completely integrated it using Compose, enabling them to easily test and implement new features. Using this new design system, the Mercari team rewrote more than 130 UI screens for its marketplace and modernized the look and feel of many of their components.

With the help of the Jetpack Libraries, Mercari’s team eliminated all legacy code during the rewrite, drastically reducing its codebase and making it more manageable for developers. “Virtually, it’s the same app with way less code,” said Allan Conda, Android technology lead at Mercari. “The rewritten app has about 355,000 fewer lines of code, which is about 69% less than what it had before.”

Moving image showing lines of code that appear and disappear on the leftmost panel of the screen. The spacing between the boxes in the center panel changes, and the overall app view reflects these changes in the rightmost panel.

Interoperability with Views as an early adopter

When the Mercari team first began its GroundUP initiative, Jetpack Compose was only available in developer preview. They wanted the app written completely in Jetpack Compose due to its new declarative approach to creating UI. However, because it was still so new, they found themselves having to solve for unique edge cases using both toolkits.

For example, on Mercari’s listing form screens, users are prompted to input details about the merchandise they want to list. Users were then supposed to be able to select photos from their device gallery and rearrange them on this screen using a drag gesture. Gesture APIs weren’t available in Jetpack Compose at the time, so the team took advantage of Compose's AndroidView to seamlessly integrate Views that handled gestures on the listing form screen. This provided a stable yet temporary solution to implementing drag gestures until the feature became available with Jetpack Compose.

The Mercari team was impressed by how easy it was to switch between the two toolkits, and having the option to use Views alongside Compose gave them better control of edge cases like this. Compose now supports gesture APIs, and Mercari developers have since completely written and integrated the drag gesture component solely using Compose.

Jetpack Compose has matured a lot since Mercari’s initial adoption, and most Android developers no longer need to worry about having to interoperate with both toolkits as Android apps can now be written completely in Compose.

Improving and monitoring performance with Compose

Using Compose, the Mercari team automated baseline profile generation for every stable release of the app and found it to be really helpful. The home screen renders frames up to 2x faster with the default Compose baseline profile compared to without a baseline profile. By providing a custom profile, there’s an additional improvement of up to 20% faster when Mercari users are scrolling compared to just having the default baseline profile.

The team also wrote automated performance tests based on the app’s core scenarios with Android Macrobenchmark. “Using Android Macrobenchmark, we can automatically test start-up, scroll, and screen load times performance,” said Allan. “Currently, we have six core scenarios covered by these tests, like search results and browsing items.”

Additionally, Mercari developers integrated Firebase Performance Monitoring, a real-time app performance monitoring tool, with custom code to calculate scrolling performance on Compose screens. With Firebase Performance Monitoring, the Mercari team detected a performance issue on its search result screen. Using the Android Profiler to pinpoint the problem, Mercari developers discovered there were poor frame rates when scrolling search results. This resulted in the slow rendering instances being reduced by around 23.6%.

The Mercari team solved this frame rate issue with guidance from Google’s Compose performance best practices and Compose stability. Mercari developers had the app skip its Composables and hoist the unused states on the search results screen, significantly improving the frame rates.

Headshot of Allan Conda, Android Tech Lead at Mercari, similing, with quote text reads 'Jetpack Compose helped us implement our Design System and rewrite 130+ screens and many of our components'

More opportunities with Jetpack Compose

With less code to maintain, it’s much easier for Mercari developers to test and implement features. “We have a ton of experiments we can finally conduct using our refreshed platforms. Our users can expect new features coming to the Mercari app at a faster rate,” said Allan.

Mercari’s developers are excited to further develop the app using Animation APIs. With Compose, it’s much easier to animate components, which can result in huge improvements for Android UXs.

Get started

Optimize your UI development with Jetpack Compose.

Developer-Powered CTS (CTS-D)

Posted by Sachiyo Sugimoto, Android Partner Engineering

A strength of Android is its diverse ecosystem of devices, brought to market by more than 24K distinct devices, and used by billions of people around the world. Since the early releases of Android, we’ve invested in our Android Compatibility Program as a way to ensure that devices continue to provide a stable, consistent environment for apps.

The Compatibility Test Suite (CTS) is a key part of the program - it is a collection of more than two million test cases that check Android device implementations to ensure developer applications run on a variety of devices and enable a consistent application experience for users.

Device makers run CTS on their devices throughout the development process, and use it to identify and fix bugs early. Over the years we have constantly expanded the suite by adding new test cases, and today CTS includes more than 2 million tests. It is still growing - as Android evolves, there are new areas to cover and there are also gaps where we are constantly working to create additional tests.

While most CTS tests are written by Android engineers, we know that app developers have a unique perspective on actual device compatibility issues. So to enhance CTS with better input from app developers, we are adding a new test suite called CTS-D that is built and run by developers like you.



What is CTS-D?

CTS-D is a new CTS module that is powered by app developers with a focus on pain points that they are seeing in the field. Developers can build and contribute test cases to CTS-D to help catch those issues, and they can run the CTS-D suite to verify compatibility. Longer term, our plan is to work closely with the Android developer community to expand the CTS-D suite.

We know that many of you have already created your own tests to verify compatibility on various devices. We want to work with you to bring those tests into AOSP, and you can see the first tests contributed by the community in the initial CTS-D commit here.

So with CTS-D, we are helping to make those kinds of tests available widely, to help device manufacturers and app developers identify and share issues more effectively.

How is CTS-D used?

CTS-D is open-sourced and available on AOSP, so any app developer can use it as a verification tool. Using CTS-D helps to minimize the communication overhead among app developers, device manufacturers and Google, helping to resolve issues effectively.

If a certain device does not pass a CTS-D test, please report the problem using this issue tracker template. After we verify the issue on the reported device, we will work with our partners to resolve it. We're also strongly advising device manufacturers to use CTS-D to discover and mitigate issues.

Get Started with CTS-D!

If you have an idea for CTS-D, please file a test proposal using this issue tracker template before contributing your test code to AOSP. The Android team will review your proposal and verify your test’s eligibility. We’re currently most interested in adding more test cases in the area of Power Management.

Just like with CTS, new CTS-D test cases must meet eligibility requirements and can only enforce the following:
  1. All public API behaviors that are described in Android developer documentation.
  2. All MUST requirements that are included in Android Compatibility Definition Document (CDD).
  3. Test cases that have not been covered by existing CTS test cases in AOSP
If you are interested in learning more about CTS-D, check out tutorials here on how to contribute to and utilize CTS-D. Note that the review process for new CTS-D test cases can take some time, so thanks for your patience. We hope you will give CTS-D a try soon. Let’s collaboratively make the Android experience even better!

Working Towards Android App Excellence

Posted by Jacob Lehrbaum Director of Developer Relations, Android

illustration of freckled hand over mobile phone with graphs

Great app experiences are great for business. In fact, nearly three-quarters of Android app users who leave a 5 star review on Google Play mention the quality of their experience with the app1; its speed, design, and usability. At Google, we want to help all developers achieve app excellence, and in turn help you drive user acquisition, retention, and monetization.

So what is “app excellence”? This may sound aspirational, but it is within reach for many apps. It starts with a laser focus on the user, and more specifically, with intuitive user experiences that get people to the main functionality of your app as quickly as possible — but that is just the beginning. Excellent apps are consistent across all of their screens and experiences. They perform well, no matter the device used. App excellence is achievable when all of the stakeholders who influence your app are invested in the experience of using your app.

One of the blockers that gets in the way of app excellence is shared or unclear accountability. Some of the primary measures of app quality, such as crashes and load times, are often seen as the responsibility of one group in the company, such as the engineering team. However, when we talk to best-in-class organizations2 about how they achieve app quality, it is clear that taking a cross-functional approach is key, with engineering, design, product, and business teams working toward a common goal.

So what are some internal best practices behind app excellence?

Make app quality a cross-organizational focus — not just an engineering concern

It’s a way easier conversation for me at the business end because I can say “these competitors’ apps are faster than ours; we need to reduce our load time down from 5 seconds to 4 seconds”.
Software engineer, x-platform app

App excellence helps drive business performance. New features are great, but if they slow down app start-up times or take up too much device space, people will eventually use your app less often or even delete it. Engineers who have built a company-wide focus on quality have often done so by quantifying the impact of quality issues on business performance, through:

  • Case studies showing the impact of responsiveness, APK size, start-up time, and memory usage on business KPIs. Here you can find practical case studies showcasing how developers such as Headspace and Duolingo achieved app excellence.
  • Benchmarking against competitor apps. Check out peer benchmarks and other metrics on the Google Play Console.

Organize teams around features and/or app user journey stages

Companies that organize teams around features — or stages in the user journey — are more likely to deliver consistent experiences across each operating system they support, bring new apps or features to market faster, and deliver a better app experience for all their customers. These teams are often cross-functional groups that span engineering, marketing, ux, and product — and are responsible for the success of a feature or user journey stage3 across all devices and platforms. In addition to better experiences and feature parity, this structure enables alignment of goals across functional areas while reducing silos, and it also helps teams hyper-focus on addressing specific objectives.

Feature organized team graph

Squads focused on business objectives heighten focus on the user.

Use the same devices your customers use

If a majority of your users are on a specific type of device, you can build empathy for their experience if you use the same phone, tablet or smart watch as your primary device. This is especially relevant for senior leadership in your organization who make decisions that impact the day-to-day experience of millions of users. For example, Duolingo has built this into their company DNA. Every Duolingo employee — including their CEO — either uses exclusively or has access to an entry level Android device to reflect a significant portion of their user base.

A user-centric approach to quality and app excellence is essential to business growth. If you are interested in learning how to achieve app excellence, read our case studies with practical tips, and sign up to attend our App Excellence Summit by visiting the Android app excellence webpage.

In subsequent blog posts, we will dig deep into two drivers of excellent app experiences: app performance and how it is linked to user behavior, and creating seamless user experiences across devices. Sign up to the Android developer newsletter here to be notified of the next installment, and get news and insights from the Android team.

Notes


  1. Internal Google Play data, 2021. 

  2. Google App Quality Research, 2021 

  3. The series of steps each user takes as they interact with your app is referred to as the “user journey.” Examples of user journey stages include installs, onboarding, engagement, and retention 

What’s new for Android developers at Google I/O

Cross-posted on the Android Developers blog by Karen Ng, Director, Product Management & Jacob Lehrbaum, Director of Developer Relations, Android & Play

As Android developers, we are all driven by building experiences that delight people around the world. And with people depending on your apps more than ever, expectations are higher and your jobs as developers aren’t getting easier. Today, at Google I/O, we covered a few ways that we’re trying to help out, whether it be through Android 12 - one of the biggest design changes ever, Jetpack, Jetpack Compose, Android Studio, and Kotlin to help you build beautiful high quality apps. We’re also helping when it comes to extending your apps wherever your users go, like through wearables and larger-screened devices. You can watch the full Developer Keynote, but here are a few highlights:

Android 12: one of the biggest design updates ever.

The first Beta of Android 12 just started rolling out, and it’s packed with lots of cool stuff. From new user safety features like permissions for bluetooth and approximate location, enhancements to performance like expedited jobs and start up animations, to delightful experiences with more interactive widgets and stretch overscrolling, this release is one of the biggest design updates to Android ever. You can read more about what’s in Android 12 Beta 1 here, so you can start preparing your apps for the consumer release coming out later this year. Download the Beta and try it with your apps today!

Android 12 visual

Jetpack Compose: get ready for 1.0 in July!

For the last few years, we’ve been hard at work modernizing the Android development experience, listening to your feedback to keep the openness–a hallmark of Android, but becoming more opinionated about the right way to do things. You can see this throughout, from Android Studio, a performant IDE that can keep up with you, to Kotlin, a programming language that enables you to do more with less code, to Jetpack libraries that solve the hardest problems on mobile with backward compatibility.

The next step in this offering is Jetpack Compose - our modern UI toolkit to easily build beautiful apps for all Android devices. We announced Compose here at Google I/O two years ago and since then have been building it in the open, listening to your feedback to make sure we got it right. With the Compose Beta earlier this year, developers around the world have created some truly beautiful, innovative experiences in half the time, and the response to the #AndroidDevChallenge blew our socks off!

With the forthcoming update of Material You (which you can read more about here), we’ll be adding new Material components as well as further support for building for large screens, making it fast and easy to build a gorgeous UI. We’re pressure testing the final bits in Compose and will release 1.0 Stable in July—so get ready!

Android Studio Arctic Fox: Design, Devices, & Developer Productivity!

Android Studio Arctic Fox (2020.3.1) Beta, the latest release of the official powerful Android IDE, is out today to help you build quality apps easier and faster. We have delivered and updated the suite of tools to empower three major themes: accelerate your UI design, extend your app to new devices, and boost your developer productivity. With this latest release you can create modern UIs with Compose tooling, see test results across multiple devices, and optimize debugging databases and background tasks with the App Inspector. We’re also making your apps more accessible with the Accessibility Scanner and more performant with Memory Profiler. And for faster build speeds, we have the Android Gradle plugin 7.0, new DSL, and variant APIs. You can learn more about the Android Studio updates here.

Android Studio Arctic Fox

Kotlin: the most used language by professional Android devs

Kotlin is now the most used primary language by professional Android developers according to our recent surveys; in fact, over 1.2M apps in the Play Store use Kotlin, including 80% of the top 1000 apps. And here at Google, we love it too: 70+ Google apps like Drive, Home, Maps and Play use Kotlin. And with a brand-new native solution to annotation processing for Kotlin built from the ground up, Kotlin Symbol Processing is available today, a powerful and yet simple API for parsing Kotlin code directly, showing speeds up to 2x faster with libraries like Room.

Android Jetpack: write features, not boilerplate

With Android Jetpack, we built a suite of libraries to help reduce boilerplate code so you can focus on the code you care about. Over 84% of the top 10,000 apps are now using a Jetpack library. And today, we’re unpacking some new releases for Jetpack, including Jetpack Macrobenchmark (Alpha) to capture large interactions that affect your app startup and jank before your app is released, as well as a new Kotlin Coroutines API for persisting data more efficiently via Jetpack DataStore (Beta). You can read about all the updates in Android Jetpack here.

Now is the time: a big step for Wear

The best thing about modern Android development is that these tools have been purpose built to help make it easy for you to build for the next era of Android, which is all about enabling devices connected to your phone–TVs, cars, watches, tablets–to work better together.

Starting today, we take a huge step forward with wearables. First, we introduced a unified platform built jointly with Samsung, combining the best of Wear and Tizen. Second, we shared a new consumer experience with revamped Google apps. And third, a world-class health and fitness service from Fitbit is coming to the platform. As an Android developer, it means you’ll have more reach, and you’ll be able to use all of your existing skills, tools, and APIs that make your mobile apps great, to build for a single wearables platform used by people all over the world.

Whether it’s new Jetpack APIs for Wear tailored for small screens and designed to optimize battery life, to the Jetpack Tiles API, so you can create a custom Tile for all the devices in the Wear ecosystem, there are a number of new features to help you build on Wear. And with a new set of APIs for Health and Fitness, created in collaboration with Samsung, data collection from sensors and metrics computation is streamlined, consistent, and accurate–like heart rate to calories to daily distance–from one trusted source. All this comes together in new tooling, with the release of Android Studio Arctic Fox Beta, like easier pairing to test apps, and even a virtual heart rate sensor in the emulator. And when your app is ready, users will have a much easier time discovering the world of Wear apps on Google Play, with some big updates to discoverability. You can read more about all of the Wear updates here.

Tapping the momentum of larger screens, like tablets, Chrome OS and foldables

When it comes to larger screens -- tablets, foldables, and Chrome OS laptops-- there is huge momentum. People are increasingly relying on large screen devices to stay connected with family and friends, go to school, or work remotely. In fact, there are over 250 million active large screen Android devices. Last year, Chrome OS grew +92% year over year–5 times the rate of the PC market, making Chrome OS the fastest growing and the second-most popular desktop OS. To help you take advantage of this momentum, we’re giving you APIs and tools to make optimizing that experience easier: like having your content resize automatically to more space by using SlidingpaneLayout 1.2.0 and a new vertical navigation rail component, Max widths on components to avoid stretched UIs, as well as updates to the platform, Chrome OS, and Jetpack windowmanager, so apps work better by default. You can learn more here.

Google Duo's optimized experience for foldable devices

Google Duo's optimized experience for foldable devices

This is just a taste of some of the new ways we’re making it easier for you to build high quality Android apps. Later today, we’ll be releasing more than 20 technical sessions on Android and Play, covering a wide range of topics such as background tasks, privacy, and Machine Learning on Android, or the top 12 tips to get you ready for Android 12. If building for cars, TVs, and wearables is your thing, we got that covered, too. You can find all these sessions - and more - on the I/O website. Beyond the sessions and news, there’s a number of fun ways to virtually connect with Googlers and other developers at this year’s Google I/O. You can check out the Android dome in I/O Adventure, where you can see new blog posts, videos, codelabs, and more. Maybe even test out your Jetpack Compose skills or take a virtual tour of the cars inside our dome!

What’s new in Android Privacy

Posted by Sara N-Marandi, Product Manager, Android Platform Product

Android privacy

People want an OS and apps that they can trust with their most personal and sensitive information. Privacy is core to Android’s product principles. As shared in the “What’s new in Android Privacy” session, Android 12 continues to expand on this existing foundation by making the platform even more private.

This release will give users more transparency around the data being accessed by apps while providing simple controls to make informed choices. Android is also investing in reducing the scope of permissions so that apps only have access to the data they need for the features they provide. Let’s look at some of these important changes we’ve made in Android 12 to protect user privacy.

Privacy dashboard: Users often tell us that they want to understand what data apps use. With the new Privacy Dashboard, users will have a simple and clear timeline view of the last 24 hour accesses to location, microphone and camera. You can also share more context about your app’s data usage with a new permission intent API in Android 12. The Privacy dashboard will be available to try in Beta 2.

We encourage all developers to review your code and understand data access needs, including those in third-party SDKs, and make sure all accesses have justifiable use cases. To help with that, in Android 11 we added Data access auditing APIs to make it easy for you to audit your current data access. Use the APIs to untangle mapping of your code by tracking which part of your code accesses private data. The Privacy dashboard will be available to try in Beta 2.

Privacy dashboard and location access timeline

Figure 1. Privacy dashboard and location access timeline in the past 24 hours.

Microphone and camera indicators: In Android 12 we’re adding transparency to microphone and camera access. Going forward, users will know in real time when an app accesses their microphone or camera feeds. By simply going into Quick Settings, users can view the apps accessing their data. If the access is unwarranted, users can quickly navigate to the app permission page to revoke permissions.

Developers should review their use of microphone and camera and proactively remove unexpected access. For example, you should ensure that your app does not access these sensors before the user clicks on a feature that needs access. The Microphone and camera indicators will be available to try in Beta 2.

 Microphone and camera indicators and toggles

Figure 2. Microphone and camera indicators and toggles.

Microphone and camera toggles: You may have seen people placing stickers on cameras or plugging audio blockers into their phones. In Android 12, we’re introducing two new controls that allow users to quickly and easily cut off apps’ access to the microphone and camera on the device. To ensure user safety, emergency calls will be exempted.

If an app with permissions attempts to access the microphone or camera but the user has the sensors turned off, the system will display a message to inform the user that they must turn the sensors back on in order to use the app’s features. If your app follows permissions best practices, then you don’t need to do anything different to incorporate the toggle state. The Microphone and camera toggles will be available to try in Beta 2.

Approximate location: Over the last two releases, we’ve made location permission fine grained. First, we separated background and foreground access. Then, we added an “only this time” option to further restrict access to background location. We’re seeing users respond positively to these controls and are choosing them more often. When given the option, users elect to share less through foreground location access about 80% of the time.

In Android 12, we will give users more control over their location data. Users will have a clear choice regarding the precision of location provided to the app by selecting approximate location.

We encourage you to review your use case for location and request ACCESS_COARSE_LOCATION if your features don’t need the user’s precise location. You should also be prepared for users to reduce location precision. Please make sure your app still works when users select approximate. Approximate location will be available to try in Beta 1.

Location permission request dialog with approximate and precise selection

Figure 3. Location permission request dialog with approximate and precise selection

Clipboard read notification: Content copied to the clipboard can contain sensitive information as users frequently copy emails, addresses, and even passwords. Android 12 notifies users every time an app reads from their clipboard. Users will see a toast at the bottom of the screen each time an app calls getPrimaryClip() . The toast won’t appear if clipboard data originates from the same app. You can minimize access by first checking getPrimaryClipDescription() to learn about the type of data in the clipboard. The recommended best practice is to only access the clipboard when the user understands why the access occured. Clipboard read notification will be available to try in Beta 2.

Nearby device permissions: Android 12 minimizes data access by adding a new runtime permission for nearby experiences that do not use location. Up until now, apps such as watch and headphone companion apps required the location permission to scan for nearby Bluetooth devices for pairing. We heard from users and developers that this was confusing and led to granting the permission to access location data when it wasn’t needed. For apps targeting Android 12, you’ll have the option to decouple nearby device discovery from the fine location permission for use cases like pairing devices by using the new BLUETOOTH_SCAN permission and by declaring usesPermissionFlags=neverForLocation . Once the device is paired, apps can use the new BLUETOOTH_CONNECT permission to interact with it. Apps that use Bluetooth scanning for location must still have the location permission. Nearby device permissions will be available to try in Beta 1.

App hibernation: Last year we launched permissions auto-reset. If an app isn’t used for an extended period of time, Android automatically revokes permissions for the app. In the last 14 days permissions were reset for 8.5M apps. This year we’re building on permissions auto-reset by intelligently hibernating apps that have gone unused for an extended period - optimizing for device storage, performance and safety. The system not only revokes permissions granted previously by the user, but it also force-stops the app and reclaims memory, storage and other temporary resources. Users can bring apps out of hibernation simply by launching the app. App hibernation will be available to try in Beta 1.

Android 12 is our most ambitious privacy release to date. Along the way, we have engaged closely with our developer community to build a platform that puts privacy at the forefront while taking into consideration the impact on developers. We thank you for your continued feedback and support in making our platform private and safe for everyone. Learn more about these changes on the developer site.

Mercari improves UI development productivity by 56% with Jetpack Compose

Posted by Chiko Shimizu, Partner Developer Advocate and Tamao Imura, Developer Marketing Manager

Mercari improves UI development productivity by 56% with Jetpack Compose

Mercari allows millions of people to shop and sell almost anything. The company was founded in 2013 in Japan, and it now is the largest smartphone-focused C2C marketplace in Japan. Mercari’s Client Architect Team started using Jetpack Compose in 2020 with the goal of using modern solutions and technologies that can scale for the long term to build their tech stack for new applications.

What they did

The Mercari team needed to implement a design system with complex state management and styling on Android Views — a very complex task. Using Jetpack Compose, they were not only able to implement this complex system, it helped them spend less time developing each screen.

Jetpack Compose also helped the team write UI code for their new app utilizing the design system, making their UI code concise and easy to understand. As a result, the team can spend more time writing screens and business logic, such as practical support for the dark theme.

In addition, the Mercari team wrote a proof-of-concept tool for integrating Figma with the design system, which automatically generates UI code from the component designs. The team said that developing this tool was easier with Compose due to its declarative nature.

“Once Android developers get used to writing Jetpack Compose code, they wouldn’t wish to go back.” - Anthony Allan Conda, Android Tech Lead at Mercari

Results

Between Jetpack Compose and their new design system, Mercari was able to use far less code to write screens. On screens with infinitely-scrollable content — a common use case — they actually reduced their code by about 56%. As a result, they were able to write more screens in the same amount of time, giving them more time to write business logic and other parts of the code.

Also, they were able to do more with the UI itself, such as incorporating animations and using intuitive APIs such as AnimatedVisibility, Crossfade, and Animatable.

Mercari is planning to continue using Jetpack Compose in their new application until its release. Their design system, with the Android SDK written in Jetpack Compose, is also designed to work with multiple applications within Mercari.

Get started

Learn more about Jetpack Compose.

What’s new for Android developers at Google I/O

Posted by Karen Ng, Director, Product Management & Jacob Lehrbaum, Director of Developer Relations, Android & Play

As Android developers, we are all driven by building experiences that delight people around the world. And with people depending on your apps more than ever, expectations are higher and your jobs as developers aren’t getting easier. Today, at Google I/O, we covered a few ways that we’re trying to help out, whether it be through Android 12 - one of the biggest design changes ever, Jetpack, Jetpack Compose, Android Studio, and Kotlin to help you build beautiful high quality apps. We’re also helping when it comes to extending your apps wherever your users go, like through wearables and larger-screened devices. You can watch the full Developer Keynote, but here are a few highlights:

Android 12: one of the biggest design updates ever.

The first Beta of Android 12 just started rolling out, and it’s packed with lots of cool stuff. From new user safety features like permissions for bluetooth and approximate location, enhancements to performance like expedited jobs and start up animations, to delightful experiences with more interactive widgets and stretch overscrolling, this release is one of the biggest design updates to Android ever. You can read more about what’s in Android 12 Beta 1 here, so you can start preparing your apps for the consumer release coming out later this year. Download the Beta and try it with your apps today!

Android 12 visual

Jetpack Compose: get ready for 1.0 in July!

For the last few years, we’ve been hard at work modernizing the Android development experience, listening to your feedback to keep the openness–a hallmark of Android, but becoming more opinionated about the right way to do things. You can see this throughout, from Android Studio, a performant IDE that can keep up with you, to Kotlin, a programming language that enables you to do more with less code, to Jetpack libraries that solve the hardest problems on mobile with backward compatibility.

The next step in this offering is Jetpack Compose - our modern UI toolkit to easily build beautiful apps for all Android devices. We announced Compose here at Google I/O two years ago and since then have been building it in the open, listening to your feedback to make sure we got it right. With the Compose Beta earlier this year, developers around the world have created some truly beautiful, innovative experiences in half the time, and the response to the #AndroidDevChallenge blew our socks off!

With the forthcoming update of Material You (which you can read more about here), we’ll be adding new Material components as well as further support for building for large screens, making it fast and easy to build a gorgeous UI. We’re pressure testing the final bits in Compose and will release 1.0 Stable in July—so get ready!

Android Studio Arctic Fox: Design, Devices, & Developer Productivity!

Android Studio Arctic Fox (2020.3.1) Beta, the latest release of the official powerful Android IDE, is out today to help you build quality apps easier and faster. We have delivered and updated the suite of tools to empower three major themes: accelerate your UI design, extend your app to new devices, and boost your developer productivity. With this latest release you can create modern UIs with Compose tooling, see test results across multiple devices, and optimize debugging databases and background tasks with the App Inspector. We’re also making your apps more accessible with the Accessibility Scanner and more performant with Memory Profiler. And for faster build speeds, we have the Android Gradle plugin 7.0, new DSL, and variant APIs. You can learn more about the Android Studio updates here.

Android Studio Arctic Fox

Kotlin: the most used language by professional Android devs

Kotlin is now the most used primary language by professional Android developers according to our recent surveys; in fact, over 1.2M apps in the Play Store use Kotlin, including 80% of the top 1000 apps. And here at Google, we love it too: 70+ Google apps like Drive, Home, Maps and Play use Kotlin. And with a brand-new native solution to annotation processing for Kotlin built from the ground up, Kotlin Symbol Processing is available today, a powerful and yet simple API for parsing Kotlin code directly, showing speeds up to 2x faster with libraries like Room.

Android Jetpack: write features, not boilerplate

With Android Jetpack, we built a suite of libraries to help reduce boilerplate code so you can focus on the code you care about. Over 84% of the top 10,000 apps are now using a Jetpack library. And today, we’re unpacking some new releases for Jetpack, including Jetpack Macrobenchmark (Alpha) to capture large interactions that affect your app startup and jank before your app is released, as well as a new Kotlin Coroutines API for persisting data more efficiently via Jetpack DataStore (Beta). You can read about all the updates in Android Jetpack here.

Now is the time: a big step for Wear

The best thing about modern Android development is that these tools have been purpose built to help make it easy for you to build for the next era of Android, which is all about enabling devices connected to your phone–TVs, cars, watches, tablets–to work better together.

Starting today, we take a huge step forward with wearables. First, we introduced a unified platform built jointly with Samsung, combining the best of Wear and Tizen. Second, we shared a new consumer experience with revamped Google apps. And third, a world-class health and fitness service from Fitbit is coming to the platform. As an Android developer, it means you’ll have more reach, and you’ll be able to use all of your existing skills, tools, and APIs that make your mobile apps great, to build for a single wearables platform used by people all over the world.

Whether it’s new Jetpack APIs for Wear tailored for small screens and designed to optimize battery life, to the Jetpack Tiles API, so you can create a custom Tile for all the devices in the Wear ecosystem, there are a number of new features to help you build on Wear. And with a new set of APIs for Health and Fitness, created in collaboration with Samsung, data collection from sensors and metrics computation is streamlined, consistent, and accurate–like heart rate to calories to daily distance–from one trusted source. All this comes together in new tooling, with the release of Android Studio Arctic Fox Beta, like easier pairing to test apps, and even a virtual heart rate sensor in the emulator. And when your app is ready, users will have a much easier time discovering the world of Wear apps on Google Play, with some big updates to discoverability. You can read more about all of the Wear updates here.

Tapping the momentum of larger screens, like tablets, Chrome OS and foldables

When it comes to larger screens -- tablets, foldables, and Chrome OS laptops-- there is huge momentum. People are increasingly relying on large screen devices to stay connected with family and friends, go to school, or work remotely. In fact, there are over 250 million active large screen Android devices. Last year, Chrome OS grew +92% year over year–5 times the rate of the PC market, making Chrome OS the fastest growing and the second-most popular desktop OS. To help you take advantage of this momentum, we’re giving you APIs and tools to make optimizing that experience easier: like having your content resize automatically to more space by using SlidingpaneLayout 1.2.0 and a new vertical navigation rail component, Max widths on components to avoid stretched UIs, as well as updates to the platform, Chrome OS, and Jetpack windowmanager, so apps work better by default. You can learn more here.

Google Duo's optimized experience for foldable devices

Google Duo's optimized experience for foldable devices

This is just a taste of some of the new ways we’re making it easier for you to build high quality Android apps. Later today, we’ll be releasing more than 20 technical sessions on Android and Play, covering a wide range of topics such as background tasks, privacy, and Machine Learning on Android, or the top 12 tips to get you ready for Android 12. If building for cars, TVs, and wearables is your thing, we got that covered, too. You can find all these sessions - and more - on the I/O website. Beyond the sessions and news, there’s a number of fun ways to virtually connect with Googlers and other developers at this year’s Google I/O. You can check out the Android dome in I/O Adventure, where you can see new blog posts, videos, codelabs, and more. Maybe even test out your Jetpack Compose skills or take a virtual tour of the cars inside our dome!

#AndroidDevChallenge – It’s a wrap!

Posted by The Jetpack Compose Team

From delightful doggos to creative countdowns and storming weather apps, the 2000 submissions to the #AndroidDevChallenge blew our socks off. We are truly amazed at the creativity and beauty of the apps you built with Jetpack Compose, Android’s new UI toolkit. Now that we judged the final challenge, let’s wrap up, look back at this incredible journey and find out who the winners are!

Week #1 - Puppy adoption app ?

The week that made us say “Aww” every time we check out our social media timelines. With this challenge you took your first steps with Compose and learned how to work with lists.

We already shipped the prizes to the first 500 successful submissions: a limited edition trophy of our Jetpack Compose superhero, made of LEGO bricks.

Jetpack Compose prize

Week #1 prize: Jetpack Compose superhero

Week #2 - Countdown timer ⏲️

When time came to implement a countdown timer, you didn’t disappoint! This challenge showed us that you mastered state and animation in Compose.

The first successful 500 submissions already got this week’s prize: a Compose poster pack.

Jetpack Compose prize

Week #2 prize: a Jetpack Compose poster pack

Week #3 - Speed round ?

We couldn’t believe how fast you were! This week you had to implement a design provided by us (the designs are still available if you want to try your hand at them in your own time). We opened the challenge in 3 different time zones, each with its own design to build. Here are the winning projects and the time it took to implement each of them:

  • WeTrade Jorge Baños - 2h 43min
  • MySoothe Nezih Yılmaz - 2h 44min
  • Bloom Takaki Hoshikawa - 5h 57min

It was incredible seeing how quickly the winners worked with themes and layouts in Compose; scoring themselves a Pixel 5 each!

Week #4 - Weather app ?

Come rain or shine, Android developers don’t disappoint! This week it rained… Compose weather apps. We judged them on 4 categories: code quality, novelty of idea, visual beauty and overall execution. As you made our job quite hard, we got some help from some of our Google Developer Experts to decide the winning projects:

Code quality: Paulo Pereira - JetWeatherfy

Novelty of idea: Roman Levinzon - Colony X Weather

Visual beauty: Chris Horner - Weather Scene

Overall execution: Corentin Bect - Flux

The winners each got a Google Pixel 5!


It was incredible to see what thousands of you built in this Jetpack Compose #AndroidDevChallenge. We hope that the challenge gave you a fun way to start learning Jetpack Compose and get ready to adopt it in your apps. If you’re new to Compose or want to dig deeper, check out our docs, codelabs & samples:

Have fun composing!

Google Developer Student Clubs in India build Android Apps with Kotlin

Posted by Siddhant Agarwal, Google Developer Student Clubs India Community Manager and Biswajeet Mallik, Program Manager, Google Developers India

Google Developer Student Clubs recently hosted Android Study Jams, a collection of community-organized study groups, in 275 campuses across India. These study jams helped students build Android apps in the Kotlin programming language via a curriculum provided by Google.

These virtual events were attended by thousands of students in 250+ colleges and saw the creation of hundreds of new Android apps made with Kotlin. To celebrate all of this exciting work, we wanted to showcase some noteworthy apps built by the Android Study Jam session participants:

Stumate App

Android 12 logo

Developed by GDSC GMR Institute of Technology, Stumate is a place for students who are looking for a solution to store all of their files and notes in one organized place on their devices. This application also allows students to send notifications to their classmates about assignments while uploading notes in a PDF, Word Document or a Presentation.

The app uses the Material Design library for the front-end and Firebase as a backend. Some of the technical concepts used in the app include:

  1. SharedPreferences and RoomDatabase to store user credentials
  2. WorkManager to schedule the reminders at a particular time
  3. Data Binding to display the content
  4. Firebase Authentication (Google Single Sign On and Email Auth), Realtime Database, Storage, Firebase Cloud Messaging, Crashlytics
  5. Firebase Test Lab to test the application on various devices

You can find this app on the Play Store here.


Ask Me Anonymously App

Android 12 logo

Ask Me Anonymously is a chat application developed by GDSC Chandigarh University where users can ask questions to one another without revealing their identity.

This app uses concepts that were taught in Android Study Jams such as:

  1. RecyclerView
  2. Activity Lifecycle
  3. Data Binding
  4. Using Glide for loading and displaying images from the internet

The application also uses Firebase Realtime Database and Firebase Cloud Storage for implementing the above-said functionality, it also uses some other notable Firebase features such as Cloud Messaging and Firebase Dynamic Links.

You can find this app on the Play Store here.

Travel Wise App

Android 12 logo

Developed by GDSC Indian Institute of Information Technology, Lucknow, Travel Wise is an app that helps users find co-travellers in their journey, allowing you to share your journey and save money on travelling.

The app uses Google Firebase for authentication and Realtime Database for storage.

Eye Tester App

Android 12 logo

In today's digital age, our screen time has dramatically increased, making eyesight problems more common. GDSC Vidyavardhaka College of Engineering developed an Eye Tester app, which tells whether one should visit a doctor or not based on a simple digital eye test.

The app uses the concept 'toast' which makes the text appear for a short period and disappear, and 'random' which generates random numbers. The app is designed using Compose’s 'constraint-layout' which gives the flexibility to design the UI of the app efficiently.

Taperback App

GDSC Veermata Jijabai Technological Institute developed Taperback, a book and novel reading Android app. In Taperback, users can read from a large collection of free books collected manually from already publicly available online websites. Books from these sites are then later uploaded to the Firebase Firestore and Storage using a custom made Web Portal, along with other metadata of the books. New books are often added daily.

This app was created using Kotlin and XML. Some of the key concepts used are Kotlin Coroutines, navigation graphs, RecyclerView, WebView, SQLite, data caching, and more.

We want to thank all the Android Study Jam facilitators for hosting these sessions and for helping students develop these exciting Android apps with Kotlin.

The Google Developer Student Clubs Community in India is now bringing their enthusiasm to the 2021 Solution Challenge, where they’re building apps that serve their local community.

Get started

Ready to start learning Kotlin and building your own Android apps? If you’re a university student, join a Google Developer Student Club near you. If you’re a professional, find the right Google Developer Group for you.