Tag Archives: latest

Improving App Performance with Baseline Profiles

Or how to improve startup time by up to 40%

Posted by Kateryna Semenova, DevRel Engineer; Rahul Ravikumar, Software Engineer; Chris Craik, Software Engineer

ALT TEXT GOES HERE


Why is startup time important?

A lot of apps find correlation between app performance and user engagement. People expect apps to be responsive and fast to load. Startup time is one of the major metrics for app performance and quality.

Some of our partners have already invested a lot of time and resources for app startup optimizations. For example, check out the Facebook story.

In this blog post we’ll discuss Baseline Profiles and how they improve app and library performance, including startup time by up to 40%. While this blogpost focuses on startup, baseline profiles also significantly improve jank as well.


History

Android 9 (API level 28) introduced ART optimizing profiles in Play Cloud to improve app startup time. On average, we’ve seen that apps' cold starts are at least 15% faster across a variety of devices when Cloud Profiles are available.


How do Profiles work?

When the app is first launched after install or update, its code runs in an interpreted mode until it is JITted. In an APK, Java and Kotlin code is compiled as dex bytecode, but not fully compiled to machine code (since Android 6), due to the cost of storing and loading fully compiled apps. Classes and methods that are frequently used in the app, as well as those used for app startup, are recorded into a profile file. Once the device enters idle mode, ART compiles the apps based on these profiles. This speeds up subsequent app launches.

Starting with Android 9 (API level 28), Google Play also provides Cloud Profiles. When an app runs on a device, the profiles generated by ART are uploaded by the Play Store app and aggregated in the cloud. Once there are enough profiles uploaded for an application, the Play app uses the aggregated profile for subsequent installs.


Problem

While Cloud Profiles are great when they are available, they aren't always ready to be used when an app is installed. Collecting and aggregating the profiles usually takes several days, which is a problem when many apps update on a weekly basis. Many users will install an update before the Cloud Profile is available. The Google Android team started looking for other ways to improve the latency of profiles.


Solution

Baseline Profiles are a new mechanism to provide profiles which can be used on Android 7 (API level 24) and higher. A baseline profile is an ART profile generated by the Android Gradle plugin using a human readable profile format that can be provided by apps and libraries. An example might look like this:

HSPLandroidx/compose/runtime/ComposerImpl;->updateValue(Ljava/lang/Object;)V
HSPLandroidx/compose/runtime/ComposerImpl;->updatedNodeCount(I)I
HLandroidx/compose/runtime/ComposerImpl;->validateNodeExpected()V
PLandroidx/compose/runtime/CompositionImpl;->applyChanges()V
HLandroidx/compose/runtime/ComposerKt;->findLocation(Ljava/util/List;I)I

Example for Compose library.


The binary profile is stored in a specific location in the APK assets directory (assets/dexopt/baseline.prof).

Baseline Profiles are created during build time, shipped as part of the APK to Play, and then sent from Play to users when an app is downloaded. They fill the gap in the ART Cloud Profile pipeline, when Cloud Profiles are not yet available, and automatically merge with Cloud Profiles when they are.


This diagram displays the baseline profile workflow from creation through end-user delivery.

This diagram displays the baseline profile workflow from creation through end-user delivery.


One of the biggest benefits of Baseline Profiles is that they can be developed and evaluated locally so developers can see realistic end-user performance improvements. They are also supported on a lower version of Android(7 and higher) than Cloud Profiles, which are only available starting in Android 9.


Impact


App devs

In early 2021, Google Maps switched from a two-week to a one-week release cycle. More frequent updates meant more frequently discarding local pre-compilation, and more users experiencing slow launches without Play Cloud Profiles. By using Baseline Profiles, Google Maps improved their average startup time by 30% and saw a corresponding increase in searches by 2.4%, an immense gain for such an established app.


Library devs

Code in a library is just like that of an app - it's not fully compiled by default, which can be a problem if it does significant work on the critical path of startup.

Jetpack Compose is a UI library that is not a part of the Android system image and thus not fully compiled when installed, unlike much of the Android View toolkit code. This was causing performance problems, especially for the first few cold launches of the app.

To solve this problem, Compose uses profile installer. It ships baseline profile rules which reduce startup time and jank in Compose apps.

Google PlayStore’s search results page has been re-written with Compose. After incorporating the Baseline Profile rules from Compose, time to render the initial search results page with images improved by ~40%.

The Android team has also added Baseline Profiles to relevant AndroidX libraries. This benefits all Android apps using these libraries. Constraint Layout has found shipping profile rules reduces animation frame times by more than one millisecond.


How to use Baseline Profiles


Create a custom Baseline Profile

All apps and library developers can benefit from including Baseline Profiles. Ideally, developers create profiles for their most critical user journeys to ensure that those journeys have consistently fast performance regardless of whether cloud profiles are available. Check out the detailed guide on how to set up Baseline Profiles for both app and library developers.


Update dependencies

If you are not ready to generate Baseline Profiles for your app right now, you can still benefit from them by updating your dependencies. If you build with Android Gradle Plugin 7.1.0-alpha05 or newer, you'll get Baseline Profiles included in your APK that are already provided by libraries (such as Jetpack). Google Play compiles your app with these profiles at install time. You can supplement these profiles as part of building your application.


Measure Improvements

Don’t forget to measure improvements. Follow the steps on how to measure startup with the generated profile locally.


Provide feedback

Please share your feedback and let us know your experience!

Building apps for Android Automotive OS

Posted by Madan Ankapura, Product Manager

Today we’re announcing the availability of version 1.2 beta of the Car App Library, enabling app developers to start building their navigation, parking, and charging apps for Android Automotive OS.

Now, developers can begin building and testing apps for these categories using the Automotive OS emulator across both Android Automotive OS and Android Auto. For the entire list of changes in v1.2 beta, please see the release notes. To start building your app for the car, check out our updated developer documentation, car quality guidelines, and design guidelines.

As announced earlier, drivers of Polestar 2 and Volvo cars can now download charging (ChargePoint, PlugShare), parking (Spothero, Parkwhiz), and navigation (Flitsmeister, Sygic) apps developed with the Car App Library by joining the Google Group and opting-in to each app's beta on the Google Play store, with your Gmail account.

six spp icons

Car App Library apps on Android Automotive OS are automatically rendered to be consistent with the rest of the experience within each car, without additional work needed from developers.. For example,

Polestar 2
Volvo
Polestar 2 setting with labeled On / Off switches for PlugShare

Polestar 2 setting with labeled On / Off switches for PlugShare

Volvo settings with sliding switches for PlugShare

Volvo settings with sliding switches for PlugShare

Polestar 2 sign-in screen for SpotHero

Polestar 2 sign-in screen for SpotHero

Volvo sign-in screen for SpotHero

Volvo sign-in screen for SpotHero

Example of app customization on Android Automotive OS

Experience for yourself how your app will look within the different systems, by accessing the OEM emulator system images downloadable in Android Studio. You can begin developing your charging, parking and navigation apps for Android Automotive OS today, and we are working to enable you to publish your apps to the Google Play store in the coming months (stay tuned!).

Beyond navigation, rideshare drivers spend a lot of time in their vehicles and will benefit from safer interactions if those apps can be brought to the car’s screen. We are working with Lyft and Kakao Mobility to bring their driver app experiences into the car in the coming months.

image of car screen with gps map and Lyft logo

We are also pleased to announce that we are expanding support to all Points of Interest apps. Beyond charging and parking, this allows any app that will help users discover and search for interesting locations on a map, and optionally enable them to navigate to such points. We are partnering with MochiMochi, Fuelio, Prezzi Benzina, and NAVITIME JAPAN as our early access partners.

If you’re interested in joining our Early Access Program in the future, please fill out this interest form. You can get started with the Android for Cars App Library today, by visiting g.co/androidforcars.

Announcing Glance: Tiles for Wear OS made simple

Posted by Anna Bernbaum, Associate Product Manager


Last year we announced the Wear Tiles API. To complement that Java API, we are excited to announce that support for Wear OS Tiles has been added to Glance, a new framework built on top of Jetpack Compose designed to make it easier to build for surfaces outside your app on Android. We'd love to get your feedback on this alpha version.

Tiles provide Wear OS users easy access to the information and actions they need in order to get things done quickly. They also are one of the most used surfaces on Wear OS. Just one swipe away from the Watch Face, users can quickly access the most important information or actions from an app, like start a timer or get the latest weather forecast.


Watch face gif


Let's see how we can create a Tile with Glance:


class HelloTileService : GlanceTileService() {
   @Composable
   override fun Content() {
       Text(text = "Hello Glance")
   }
}

The simple code above generates the Tile below.


“Hello Glance” Tile sample with Glance

“Hello Glance” Tile sample with Glance


Note: Using Glance-wear-tiles requires`minSdkVersion`>= 26.



How it works

Glance creates “glanceable” experiences across Android surfaces using a base-set of Composables. For Tiles on Wear OS, Glance translates Composables into Tiles.


Diagram: Glance structure 

Diagram: Glance structure


Glance requires Compose to be enabled and depends on Runtime, Graphics, and Unit UI Compose layers, but it’s not directly interoperable with other existing Jetpack Compose UI elements, like Compose for Wear OS.

What’s in the Alpha

This initial release introduces the main APIs to build wear Tiles:

We are working on bringing even more functionality with default theming, further Android Studio support, and more. Stay tuned for new releases.

Get started with Glance

For a quick start, take a look at the samples in the AndroidX repository. Glance works with the latest stable Android Studio, although since Glance relies on Compose Runtime, follow the steps on the Jetpack Compose docs to set it up first.

The Alpha version is your opportunity to influence the APIs, so please share your feedback and let us know your experience!

Happy Composing with Glance!

Android Studio Bumblebee (2021.1.1) Stable

Posted by Adarsh Fernando, Product Manager, Android

Bumblbee Android Studio

The Android Studio team has been abuzz with the stable release of Android Studio Bumblebee (2021.1.1) ? and Android Gradle plugin (AGP) 7.1.0; the latest versions of Android official IDE and build system. We’ve improved functionality across a broad area of the typical developer workflow: Build and Deploy, Profiling and Inspection, and Design.

Some notable additions include a unified test execution between Android Studio and your continuous integration (CI) server ✅, convenient pairing flows to support ADB over Wi-Fi ?, Improved Profiler tools to help you identify and analyze jank in your app ?️, and new ways to preview animations ? and UI interactions without deploying your app to a device.

As always, this release wouldn’t be possible without the early feedback from our Preview users. So read on or watch below for further highlights and new features you can find in this stable version. If you’re ready to jump in and see for yourself, head over to the official website to download Android Studio Bumblebee (2021.1.1).


What’s in Android Studio Bumblebee (2021.1.1)

Below is a full list of new features in Android Studio Bumblebee (2021.1.1), organized by the three major themes.

Build and Deploy

  • New Device Manager: This new tool window in Bumblebee makes it easier to see and manage your virtual and physical test devices, and you can open it by selecting View > Tool Windows > Device Manager from the main menu bar. In the Virtual tab, create a new device, review device details, delete a device, or anything else you used to do from the now removed AVD Manager. In the Physical tab, quickly pair to a new device using ADB Wi-Fi and see details of each physical device at a glance, or quickly inspect each device’s file system using the Device File Explorer with a click of a button. Learn more about the New Device Manager in the release notes.
Device Manager

Device Manager


  • ADB over Wi-Fi: Bumblebee includes a simplified flow to connect to your Android 11 and higher devices over Wi-Fi for deployment and debugging using ADB. After you enable debugging over Wi-Fi on your device, select the Pair using Wi-Fi action in the Physical tab of the new Device Manager to open the pairing wizard. Then follow the steps provided to pair to a device connected over the same network. Learn more.
Pairing a device with ADB over Wifi

Pairing a device with ADB over Wifi


  • Run Instrumented Tests in Android Studio using Gradle: Have you ever run tests in Android Studio with different results than the same tests running on your CI? This can be a frustrating issue that leads to lost productivity. To resolve this issue, we’ve introduced a new test runner to Android Gradle plugin (AGP) 7.1.0 that Android Studio Bumblebee uses by default when running instrumentation tests, so all your tests run through a unified test runner. This is a similar improvement to Android Studio Arctic Fox, where we started running all unit tests via Gradle by default. And, similarly, this improvement doesn’t require you to change how you write or run your tests!

Using different runners lead to inconsistent results

Using different runners lead to inconsistent results


Android Studio now runs instrumentation tests via Gradle

Android Studio now runs instrumentation tests via Gradle


  • Android Gradle Plugin Upgrade Assistant now updates API usage: Originally introduced in Android Studio 4.2, the AGP Upgrade Assistant helped users update their projects to the latest version, and improvements in Arctic Fox provided a new UI with the ability to review and select the upgrade version and steps. In Bumblebee, the Upgrade Assistant now also checks for and offers to update your DSL to help you avoid using deprecated APIs before they are deleted. For more information see the Android Gradle Plugin DSL/API migration timeline.
  • Non-Transitive R classes on for new projects: Android Studio Arctic Fox introduced new refactoring tools to help you use non-transitive R classes to enable faster builds for applications with multiple modules. When creating new projects using Bumblebee, the IDE configures your project to use non-transitive R classes, by default. While this does bring performance improvements, you now have to refer to R classes by their proper package name, and not by the package names of their parent modules, as they will no longer resolve transitively. For more information see Use non-transitive R classes.
  • Emulator tool window enabled by default: Introduced in Android Studio 4.1, the Emulator launches within an Android Studio tool window and allows you to deploy and interact with virtual Android devices while fully remaining within the context of the IDE. The changes ads an improved UX for extended controls and snapshot management. For more information see Run the Android Emulator directly in Android Studio.
  • Apple Silicon Support Update - For those using macOS on Apple Silicon (arm64) hardware, Android Studio Arctic Fox and the Android Emulator have supported this new architecture since last year. However, with this release, we have now updated the Android SDK platform tools v32.0.0 (which includes ADB and fastboot) and build tools v32.1.0 (which includes aapt) to be universal binaries so that your Android developer tools no longer need the Rosetta binary translator to run. Based on community feedback, those developers on this hardware platform have seen notable performance improvements. See release notes.


Profile and Inspect

  • Jank detection track in Profilers: When profiling your app using devices running Android 11 (API level 30) or higher, the CPU profiler now shows a new group of tracks that illustrate the stages of each frame under Frame Lifecycle: Application, Wait for GPU, Composition and Frames on display. Each track labels the frames with a frame number and color-codes the rectangle to make it easy for you to visualize where a particular frame is in its lifecycle, along with guides you can toggle to compare with Vsync events. You can use this data to understand where Jank might occur in your app and investigate the root causes. In the Analysis panel, there is now a Frames tab, which conveniently summarizes rendering information for all frames. For more information, see UI jank detection.

Detailed frame lifecycle information in the CPU Profiler

Detailed frame lifecycle information in the CPU Profiler


  • Profileable app profiling support in Studio Profilers: When profiling your app, it’s important to generate accurate data with the version of your app that most closely resembles what your users will install. To do so, you can now include the <profileable> property in your app’s manifest to profile apps that are not debuggable, as shown below.

    <profileable android:shell="true"/>

    Profileable is a manifest configuration introduced in Android 10, and is available for CPU and Memory profiling tasks. Using the profileable flag instead of the debuggable flag has the key advantage of lower overhead for performance measurement; however, certain profiling features are not available for Profileable builds, such as the Event timeline, API initiated CPU profiling, heap dumps, or live location recordings. For more information, see Profileable applications.
  • Inspect Jobs, Alarms, and Wakelocks: The Background Task Inspector has been expanded to allow you to inspect Jobs, Alarms, and Wakelocks. You can see live information on how these background tasks are being scheduled, and see detailed information about their execution, similar to how you can inspect Workers. Additionally, when inspecting Workers, you can track and inspect Jobs that your Workers schedule for you. If you used to use the Energy Profiler in previous versions of the IDE, you should now navigate to View > Tool Windows > App Inspection from the menu bar and select the Background Task Inspector to inspect Jobs, Alarms, and Wakelocks.

Inspect Jobs, Alarms, and Wakelocks in the Background Task Inspector

Inspect Jobs, Alarms, and Wakelocks in the Background Task Inspector


  • Network Inspection: The Network Profiler has now migrated to the App Inspection tool window, to allow for a lighter-weight experience for inspecting network traffic in your app. The look and feel of the Network Profiler has been maintained and works with any debuggable app on devices running API level 26 and higher. To use the new inspector, select View > Tool Windows > App Inspection from the menu bar and select the Network Inspector. For more information, see Inspect network traffic with the Network Inspector.
  • Capture Layout Inspector snapshots: You can now capture snapshots of your app’s layout hierarchy to save, share, or inspect later. Snapshots capture the data you would typically see when using the Layout Inspector, including a detailed 3D rendering of your layout, the component tree of your View, Compose, or hybrid layout, and detailed attributes for each component of your UI. When inspecting the layout of a live running app, click Export snapshot from the Layout Inspector toolbar and save the snapshot with an *.li extension. You can then load a Layout Inspector snapshot by selecting File > Open from the main menu bar, and opening a *.li file. The snapshot appears in a tab in the Editor window, so that you can easily compare it with your running app. Learn more at Capture layout hierarchy snapshots.

GIF  
  • Support for Compose semantics in the Layout Inspector: In Compose, Semantics describe your UI in an alternative manner that is understandable for Accessibility services and for the Testing framework. In Android Studio Bumblebee, you can now use the Layout Inspector to inspect semantic information in your Compose layouts. When selecting a Compose node, use the Attributes window to check whether it declares semantic information directly, merges semantics from its children, or both. To quickly identify which nodes include semantics, either declared or merged, use select the View options dropdown in the Component Tree window and select Highlight Semantics Layers.

Design

  • Interactive Preview: Android Studio Arctic Fox launched with support to statically preview your composable functions in the Design / Split window of the Editor. In Bumblebee, we’ve expanded functionality to allow you to interact with certain components of your Compose layouts, to validate behavior without building and deploying the full app to a running device! To get started, navigate to a previewable compose function and click Start Interactive Mode in the Design / Split window. For more information see Interactive mode.

Interact with the Compose Preview to validate behavior

Interact with the Compose Preview to validate behavior


  • Animated Vector Drawables Preview: The Preview window is now also available when viewing vector drawables. When viewing a static drawable, you can use the preview window to change background options between “None”, “White”, “Black”, “Checkedered”, to view your drawable against different conditions. Animated drawables also provide the option to preview the animation at different speeds as well as backgrounds, to help you test animations before using them in your app. To learn more, see Animated Vector Drawables (AVD) preview.

Preview your animated vector drawables

Preview your animated vector drawables


  • Updated Device picker for design tools: To simplify designing your app for the diverse number of Android devices, we’ve updated the device picker in various design tool windows, such as Layout Editor and Layout Validation, with reference devices that reflect popular sizes of each device form factor. From phones to tablets, and Wear devices to Android TVs, it’s now easier to preview, validate, or edit your layout on screen sizes that are most representative of popular real-world devices. To learn more, see Change the preview appearance.

ALT TEXT GOES HERE

To recap, Android Studio Bumblebee (2021.1.1) includes these new enhancements & features:

Build and Deploy
  • Run Instrumented Tests in Android Studio using Gradle
  • Android Gradle Plugin Upgrade Assistant now updates API usage
  • Non-Transitive R classes on for new projects
  • New Device Manager
  • ADB over Wi-Fi
  • Emulator tool window enabled by default
  • Apple Silicon Support Update
Profile and Inspect
  • Jank detection track in Profilers
  • Profileable app profiling support in Studio Profilers
  • Inspect Jobs, Alarms, and Wakelocks in the Background task Inspector
  • Capture Layout Inspector snapshots
  • Support for Compose semantics in the Layout Inspector
Design
  • Interactive Preview
  • Animated Vector Drawables Preview
  • Updated Device picker for design tools

Google Play Games beta launches on PC in Korea, Taiwan, and Hong Kong

Posted by Arjun Dayal, Group Product Manager, Google Play Games

 Google Play Games Logo

In December, we announced that Google Play Games will be coming to PCs. As part of our broader goal to make our products and services work better together, this product strives to meet players where they are and give them access to their games on as many devices as possible. We're excited to announce that we’ve opened sign-ups for Google Play Games as a beta in Korea, Taiwan, and Hong Kong.

Introduction video of Google Play Games beta

Users participating in the beta can play a catalog of Google Play games on their Windows PC via a standalone application built by Google. We’re excited to announce that some of the most popular mobile games in the world will be available at launch, including Mobile Legends: Bang Bang, Summoners War, State of Survival: The Joker Collaboration, and Three Kingdoms Tactics, which delight hundreds of millions of players globally each month.

Google Play Games beta PC application

This product brings the best of Google Play to more laptops and desktops, enabling immersive and seamless gameplay sessions between a phone, tablet, Chromebook, and Windows PC. Players can easily browse, download, and play their favorite mobile games on their PCs, while taking advantage of larger screens with mouse and keyboard inputs. No more losing your progress or achievements when switching between devices, it just works with your Google Play Games profile! Play Points can also be earned for Google Play Games activity on PCs.

Google Play Games gameplay on multiple devices including a phone, PC, and tablet.

We’re thrilled to expand our platform for players to enjoy their favorite Android games even more. To sign up for future announcements, or to access the beta in Korea, Taiwan, and Hong Kong, please go to g.co/googleplaygames. If you’re an Android developer looking to learn more about Google Play Games, please express interest on our developer site. We’ll have more to share on future beta releases and regional availability soon.

Windows is a trademark of the Microsoft group of companies.
Game titles may vary by region.

Creating an app to help your community during the pandemic with Gaston Saillen #IamaGDE

Posted by Alicja Heisig, Developer Relations Program Manager

Welcome to #IamaGDE - a series of spotlights presenting Google Developer Experts (GDEs) from across the globe. Discover their stories, passions, and highlights of their community work.

Gaston Saillen started coding for fun, making apps for his friends. About seven years ago, he began working full-time as an Android developer for startups. He built a bunch of apps—and then someone gave him an idea for an app that has had a broad social impact in his local community. Now, he is a senior Android developer at Distillery.

Meet Gaston Saillen, Google Developer Expert in Android and Firebase.

Photo of Gaston

Building the Uh-LaLa! app

After seven years of building apps for startups, Gaston visited a local food delivery truck to pick up dinner, and the server asked him, “Why don’t you do a food delivery app for the town, since you are an Android developer? We don’t have any food delivery apps here, but in the big city, there are tons of them.”

The food truck proprietor added that he was new in town and needed a tool to boost his sales. Gaston was up for the challenge and created a straightforward delivery app for local Cordoba restaurants he named Uh-Lala! Restaurants configure the app themselves, and there’s no app fee. “My plan was to deliver this service to this community and start making some progress on the technology that they use for delivery,” says Gaston. “And after that, a lot of other food delivery services started using the app.”

The base app is built similarly to food delivery apps for bigger companies. Gaston built it for Cordoba restaurants first, after several months of development, and it’s still the only food delivery app in town. When he released the app, it immediately got traction, with people placing orders. His friends joined, and the app expanded. “I’ve made a lot of apps as an Android engineer, but this is the first time I’ve made one that had such an impact on my community.”

He had to figure out how to deliver real-time notifications that food was ready for delivery. “That was a little tough at first, but then I got to know more about all the backend functions and everything, and that opened up a lot of new features.”

He also had to educate two groups of users: Restaurant owners need to know how to input their data into the app, and customers had to change their habit of using their phones for calls instead of apps.

Gaston says seeing people using the app is rewarding because he feels like he’s helping his community. “All of a sudden, nearby towns started using Uh-LaLa!, and I didn't expect it to grow that big, and it helped those communities.”

During the COVID-19 pandemic, many restaurants struggled to maintain their sales numbers. A local pub owner ran a promotion through Instagram to use the Uh-Lala! App for ten percent off, and their sales returned to pre-COVID levels. “That is a success story. They were really happy about the app.”

image of person holding a phone and an image of an app on the phone

Becoming a GDE

Gaston has been a GDE for seven years. When he was working on his last startup, he found himself regularly answering questions about Android development and Firebase on StackOverflow and creating developer content in the form of blog posts and YouTube videos. When he learned about the GDE program, it seemed like a perfect way to continue to contribute his Android development knowledge to an even broader developer community. Once he was selected, he continued writing blog posts and making videos—and now, they reach a broader audience.

“I created a course on Udemy that I keep updated, and I’m still writing the blog posts,” he says. “We also started the GDG here in Cordoba, and we try to have a new talk every month.”

Gaston enjoys the GDE community and sharing his ideas about Firebase and Android with other developers. He and several fellow Firebase developers started a WhatsApp group to chat about Firebase. “I enjoy being a Google Developer Expert because I can meet members of the community that do the same things that I do. It’s a really nice way to keep improving my skills and meet other people who also contribute and make videos and blogs about what I love: Android.”

The Android platform provides developers with state-of-the art tools to build apps for user. Firebase allows developers to accelerate and scale app development without managing infrastructure; release apps and monitor their performance and stability; and boost engagement with analytics, A/B testing, and messaging campaigns.

photo of a webpage in another language

Future plans

Gaston looks forward to developing Uh-La-La further and building more apps, like a coworking space reservation app that would show users the hours and locations of nearby coworking spaces and allow them to reserve a space at a certain time. He is also busy as an Android developer with Distillery.

Photo of Gaston on a telelvision show

Gaston’s advice to future developers

“Keep moving forward. Any adversity that you will be having in your career will be part of your learning, so the more that you find problems and solve them, the more that you will learn and progress in your career.”

Learn more about the Experts Program → developers.google.com/community/experts

Watch more on YouTube → https://goo.gle/GDE

Follow us on Twitter and LinkedIn

MAD Skills Gradle and AGP build APIs Wrap Up!

Posted by Murat Yener, Android Developer Advocate

MAD Skills graphic

That’s a wrap! We’ve just finished a new MAD skills series on Gradle and Android Gradle plugin build APIs. In this series we shifted gears and took a look at how you can extend your build by using Gradle and brand new Android Gradle plugin APIs.

We covered how Gradle works, how you can configure the Android Gradle plugin, and learned which APIs to use to help customize your builds and keep your builds fast and efficient. If you missed this series or some of the episodes, here is a quick recap of what to expect.

Episode 1: Configure your build - Intro to Gradle and AGP

Gradle is a general purpose build tool which can build specific project types by using plugins. Plugins introduce a way to configure the build and decide which tasks are needed to build that project. Gradle configures and executes these tasks in different phases. Understanding how the build phases work and how to configure the Android Gradle plugin can help you customize your build according to your project’s needs and keep build times efficient.

You can check out the following video or if you prefer, read the article.


Episode 2: How to write a plugin

Extending your build by writing your own plugin gives you a way to customize your build even further! Starting with version 7.0, Android Gradle Plugin now offers stable extension points for manipulating variant configuration and the produced build artifacts. In this episode we started with writing a custom task and used the new Variant API to initialize and modify properties of Variants.

You can find the same content in article form.


Episode 3: Taking your plugin to the next step

As we saw in previous episodes, keeping your config phase fast and resolving values lazily can help keep your builds efficient. Providers and Properties let you pass inputs and receive outputs from Gradle tasks lazily. In this episode we also take a look at the new Artifacts API to access and modify the app manifest.

Check out the article or the following video.


Episode 4: Gradle and AGP Build APIs Community Tip

In the last episode in the series, we feature Alex Saveau, who maintains the Gradle Play Publisher and Version Orchestrator plugins. Alex shares a tip on using modern AGP and Gradle APIs to manipulate Android build artifacts.

To learn more, check out the following video.


Episode 6: Live Q&A

Finally, we wrapped up this series with a live Q&A session where we answered your questions. If you missed the Q&A, make sure to check out the following recording.


If you are interested to learn more, make sure to check out the resources and the Gradle recipes repo linked below! See you in the next MAD Skills series.

Recipes repo: https://github.com/android/gradle-recipes

Extend the Android Gradle plugin: https://developer.android.com/studio/build/extend-agp

AGP Roadmap: https://goo.gle/3EuNYXz

Announcing Jetpack Glance Alpha for app widgets

Posted by Marcel Pintó Biescas, Developer Relations Engineer, @marxallski

Illustration of a laptop with the Android rocket logo

Android 12 revamps a key feature for many Android users, App Widgets, making them more useful, beautiful, and discoverable (84% use at least 1 widget). Today, we’re making it even easier to build them by releasing the first alpha of Jetpack Glance, a new framework built on top of the Jetpack Compose runtime designed to make it faster and easier to build app widgets for the home screen and other surfaces.

We’d love you to give it a try and share your feedback!

Glance offers similar modern, declarative Kotlin APIs that you are used to with Jetpack Compose, helping you build beautiful, responsive app widgets with way less code.

Glance “Hello World” widget sample

Glance “Hello World” widget sample


class GreetingsWidget(private val name: String): GlanceAppWidget() {
    @Composable
    override fun Content() {
        Text(text = "Hello $name")
    }
}

class GreetingsWidgetReceiver : GlanceAppWidgetReceiver() {

    override val glanceAppWidget = GreetingsWidget("Glance")
}

How it works

Glance provides a base-set of Composables to help build “glanceable” experiences. Starting today with app widget components but with more coming. Using the Jetpack Compose runtime, Glance can translate Composables into actual RemoteViews, and display them in an app widget.


Diagram: Glance structure

Diagram: Glance structure


This means that Glance requires Compose to be enabled and depends on Runtime, Graphics, and Unit UI Compose layers, but it’s not directly interoperable with other existing Jetpack Compose UI elements. However, state or any other logic within your app can be shared to create a glanceable UI.


What's in Alpha

This initial release introduces the main APIs to enable you to build app widgets in addition to providing interoperability with existing RemoteViews.

Here’s an overview of what the library offers, at a glance:

We are working on bringing even more functionality with default theming, further Android Studio support, and more. Stay tuned for new releases.



Get started with Glance

Check out the sample on GitHub for a quick start. Glance works with the latest stable Android Studio, although since Glance relies on Compose Runtime, follow the steps on the Jetpack Compose docs to set it up first.

In addition, for a more advanced showcase, checkout the demos in the AndroidX repository.


ResponsiveAppWidget.kt demo

ResponsiveAppWidget.kt demo

The Alpha version is your opportunity to influence the APIs, so please share your feedback and let us know your experience!

Happy Composing with Glance!

Rebuilding our guide to app architecture

Posted by Manuel Vicente Vivo, Developer Relations Engineer, @manuelvicnt

Android robot under a flow chart graphic

As Android apps grow in size, it's important to design the code with an architecture in place to allow the app to scale, improve quality and robustness, and make it easier to test.

An app architecture defines the boundaries between parts of the app and the responsibilities each part should have. This favors the separation of concerns principle that enables the aforementioned benefits.

In response to community demand for up-to-date guidance on app architecture, we're launching a revamped guide to app architecture. This includes best practices and recommended architecture for building robust, high-quality apps. It also provides a page for each layer of the recommended architecture: UI, domain, and data layers. Within them, you'll find deep dives into more complex topics, such as how to handle UI events.

Each Android app should have at least two layers:

  • The UI layer that displays application data on the screen.
  • The data layer that contains the business logic of your app and exposes application data.

You can add an additional layer called the domain layer to simplify and reuse the interactions between the UI and data layers.

flow chart showing UI layer, domain layer, data layer

General diagram of a typical app architecture. The UI layer gets the application data from the optional domain layer, or the data layer, that exposes application data.


We have created a learning pathway to help you consume this content in order and in a trackable way. Don't miss the chance to learn all of this and get a badge as recognition!


badge

Is this for you?

If you’re a beginner, you should begin by understanding the benefits of having an app architecture and then follow these recommendations as a first approach to the topic. Intermediate and advanced developers can follow these recommendations and customize them to their needs. In fact, our research suggests that most professional developers are already using these best practices.

You might be wondering if you should update your existing architecture to follow this recommendation, and the answer is no… or wait… it's up to you. If your current architecture works for your team, you might want to stick with it. But you might also find patterns in our guides you can benefit from and incorporate into your app.

We’re not done yet

This is the first batch of documents we're releasing, with more to come in 2022. Help us make the guidance better! If you have any feedback on the current recommendations or if you want to see other architecture-related topics in them, let us know in our docs issue tracker.

Launching Notes from Google Play | A year of evolution

Posted by Purnima Kochikar, Vice President, Google Play Partnerships

Notes from Play title card

Hello there,

Today we are kicking off Notes from Google Play, a new series where several times a year we celebrate your creativity and impact, and share key insights and best practices, to inspire you to be bolder, go further, and build even more innovative apps and games.

Purnima Kochikar addresses our goals behind the 'Notes from Google Play' series.

2021 continued to be a year of challenges and uncertainty, and you inspired us by your ability to turn obstacles into useful and joyful apps and services. Your apps helped over 2.5 billion people using Android devices learn, connect, relax, exercise, laugh, have fun, and so much more. As a result, developers making over 1M USD per month with Google Play’s billing or having 10 million monthly active users grew by 30% this year.

In this inaugural edition of Notes from Google Play we celebrate your creativity and resilience. A developer who exemplified these traits and deeply moved and inspired me and my team is Mohammed Kamara. Thank you, Mo for channeling deep personal loss to create a better world for women of color, providing affordable and customized healthcare through the app. We are humbled to play a small part in making your vision for InovCares a reality.


Mohamed Kamara, CEO and Founder of InovCares, tells the story behind his groundbreaking healthcare app.


A special shout out also goes to the winners of the Best of Google Play Awards and the Indie Games Festival. All of you inspire us to continue to work hard to evolve Play and Android to enable you to build great apps and successful businesses.

This focus on you and your success resulted in many impactful developments in 2021, including the evolution of our business model and new product features and tools. At Google Play we are focused on two key goals - helping you build and grow sustainable global businesses and investing in Android and Play platform features, tools, and ecosystems to enable you to build innovative apps and games.


illustration of people standing on a bar graph

Supporting your business growth

As the mobile industry has matured, you have created app businesses that have varying needs, so we’ve designed multiple programs to support you. For example, we created the Play Media Experience Program to encourage Video, Audio, and Books developers to build great cross-device experiences, while enabling apps that support authors & musicians by discounting the service fee as low as 10%. A few months ago we announced a new fee structure to support the evolution of the subscriptions business model, allowing all subscription app developers to benefit from lower fees. Due to the innovative changes we announced this year, I’m thrilled to share that 99% of developers globally now qualify for a service fee of 15% or less. Thank you for your thoughtful feedback while we were designing these programs and your vocal support since the launch of the new fee structure.

We have also continued to invest in programs to help you reach, retain, and re-engage your users.

  • Google Play Pass is now available in 90 countries with over 800 games and apps; those of you participating have on average more than doubled your revenue across participating titles in these regions.
  • Google Play Points is now available in 28 countries. By interacting with and paying for your apps, consumers have earned over 20 billion points to date.


Helping you build high quality apps

We are committed to empowering you to turn your creative ideas into excellent apps and have created tools and guidelines to help ensure your apps are of high quality. I invite you to pay attention to three key features/guidelines:



illustration of person with a giant key

Helping you build user trust and loyalty

Trust and safety are the cornerstones of sustainable business success and key to user loyalty. This year, we continued to invest in platform features and policies that help you build safer apps and strengthen user trust. We also heard your feedback and have invested in educational tools and resources to help you anticipate and understand the new features and policies. The key highlights this year -

  • Earlier this year, we shared details about the upcoming Data safety section in the Play store, which will let users know the type of data your app collects, stores, and how that data is used. By giving you a way to showcase your approach to privacy-and-security, we’re not only building user trust, we’re helping people make informed decisions about the apps they install and use.
  • To help you protect your business from abuse and your users from attack we created the Play Integrity API, which lets your backend server determine whether it’s interacting with your genuine app binary, installed by Google Play, and running on a genuine Android device that’s powered by Google Play services.
  • To help you build safer and more trusted apps, we have created webinars and new Google Play Console features to help you anticipate and understand policy changes, policy violations, and the process to appeal a decision. Please opt-in to receive email invites to upcoming policy webinars.




illustration of people on devices

Fostering the next generation of developers

Nothing excites me more than finding and nurturing the next generation of talented developers and building local ecosystems around the world that address local needs. Earlier this year we announced a reduced service fee tier of 15% on the first $1M in annual earnings for all developers, helping us continue to foster innovation on Android/Play.

It has been truly humbling to see key influencers, stakeholders, and industry and government leaders co-invest with us in this effort. Our most successful developers invested personal time and energy to mentor, coach, and grow Indies through the Indie Games Accelerator. Government leaders partnered with us to support startup ecosystems in countries like Korea and India - the ChangGoo program in Korea has been created in partnership with Ministry of SMEs and Startups (MSS) and the Korea Institute of Startup & Entrepreneurship Development (KISED), whereas the Appscale Academy in India was established in partnership with the MeitY Startup Hub, an initiative of the Ministry of Electronics and Information Technology (MeitY). Thank you all for your commitment to innovation and the app ecosystem.


Get a snapshot view of Appscale Academy: our growth and development program for startups across India.

Staying connected

I have missed seeing you in person over the last two years. The challenges imposed by COVID-19 helped us find new ways to stay connected. Many of you participated in virtual sessions to learn about new market opportunities and engaged in thoughtful online discussions on topics as diverse as Future of Work, Diversity, Equity, and Inclusion, and Growth and Global expansion strategies. Some of you also told us that you are feeling some online event fatigue, so this year we also invested in content that you can consume at your own pace including thought leadership and best practices, and e-learning courses on Play Academy. We even launched our first certificate to help you get the most out of our store listing tools and features.

Until the next edition, from my team to yours, best wishes for the upcoming year. We hope you will always see Google Play as a partner to help you delight your users, expand your audience, and grow your business.

Happy Holidays.

Purnima Kochikar,

Vice President, Google Play Partnerships

Make sure you don’t miss future editions by following me / us on Twitter or signing up to our monthly newsletter.