Tag Archives: Android app developers

Level Up Your App: Why Android Widgets are a Game-Changer

Posted by André Labonté – Senior Product Manager, Android Widgets

If you're an Android app developer and you're looking to boost your app's visibility, and engagement, you should definitely consider adding widgets. These small but mighty UI elements can have a significant impact on your app's success.

A widget is basically a UI that lives outside your main app. Widgets act like a window into your app content and a shortcut to your core features, which users can conveniently engage with right from their home screen, lock screen, or even through digital assistants.

Why Widgets are Awesome for Your App:

    • More Visibility: Widgets put your brand and key features front and center on the user's device, so they're more likely to see it.
    • Better User Engagement: By giving users quick access to important features, widgets encourage them to use your app more often.
    • Increased Conversions: You can use widgets to recommend personalized content or promote premium features, which could lead to more conversions.
    • Happier Users Who Stick Around: Easy access to app content and features through widgets can lead to overall better user experience, and contribute to retention.

Understanding What Users Want: Key to Good Widget Design

People use widgets for different reasons. Understanding these motivations is crucial for designing widgets that resonate.

    • Customization: Users like to personalize their home screens. Think about how your app's content can help them do that.
    • Efficiency: Widgets give users quick access to the features they use a lot, which saves them time and effort. If your app has features that users would find handy to access right from their home screen, think about putting them in a widget.
    • Quick Info: Some widgets are great for giving users essential info at a glance. If users often open your app for quick updates, a glanceable widget.

Building Awesome Widgets: Tips for Developers

Here's how to make widgets that users will love:

    • Focus on Value: Make sure your widget does something useful for users without them having to open the app.
    • Keep it Simple: Design widgets that are easy to use and understand.
    • Make it Adaptable: Test your widgets on different Android devices (phones, tablets, foldables) to make sure they work well on all of them.
    • Match the Look: Design widgets that fit in with the system's overall look by using system colors, fonts, and corner shapes.
    • Make it Easy to Find: Use the widget pinning API to encourage users to add your widget from within your app. Give them good previews and descriptions so they know what it's all about.

Get Inspired and Start Building

We encourage you to integrate widgets into your Android app strategy. For inspiration and guidance, explore our new Widget design gallery, featuring Canonical Widget Layouts.

We can't wait to see the awesome widgets you come up with!


This blog post is part of our series: Spotlight Week on Widgets, where we provide resources—blog posts, videos, sample code, and more—all designed to help you design and create widgets. You can read more in the overview of Spotlight Week: Widgets, which will be updated throughout the week.

Google Play enhances widget discovery to drive engagement with your app

Posted by Yinka Taiwo-Peters – Product Manager

Android developers, we've heard you. Historically, one of the challenges with investing in widget development has been discoverability and user understanding. You've asked for better ways for users to find and utilize your widgets, and we're delivering. Google Play now offers significant enhancements to widget discovery, creating a prime opportunity to re-engage with your users on a deeper level.

We understand that the effort required to build and maintain widgets needs to be justified by user adoption, that’s why we’ve designed these key improvements, which are coming soon to Google Play on Android phones, tablets and foldables:

    • Dedicated Widgets Search Filter: Users can now directly search for apps with widgets using a dedicated filter on Google Play. This means your apps/games with widgets will be easily identified, helping drive targeted downloads and engagement.
    • New Widget Badges on App Detail Pages: We’ve introduced a visual badge on your app’s detail pages to clearly indicate the presence of widgets. This eliminates guesswork for users and highlights your widget offerings, encouraging them to explore and utilize this capability.
    • Curated Widgets Editorial Page: We're actively educating users on the value of widgets through a new editorial page. This curated space showcases collections of excellent widgets and promotes the apps that leverage them. This provides an additional channel for your widgets to gain visibility and reach a wider audience.
Three side-by-side displays of using the widget filter in Google Play Store
click to enlarge

What this means for you:

    • Increased User Engagement: Enhanced discoverability may translate to more users finding and using your widgets, leading to increased app engagement and user retention.
    • New Opportunities for User Interaction: Widgets offer a unique way to provide value and interact with users on their home screens, fostering a deeper connection with your app.
    • Renewed Investment Justification: The improved discoverability features make widget development a more viable and rewarding investment.

We encourage you to revisit your app strategy and consider the potential of widgets. With these new discovery tools, Google Play is making it easier than ever for users to find and love your widgets. Now is the time to leverage the power of widgets and enhance your Android app experience.


This blog post is part of our series: Spotlight Week on Widgets, where we provide resources—blog posts, videos, sample code, and more—all designed to help you design and create widgets. You can read more in the overview of Spotlight Week: Widgets, which will be updated throughout the week.

Gemini in Android Studio, now helping you across the development lifecycle

Posted by Sandhya Mohan – Product Manager, Android Studio

This is Our Biggest Feature Release Since Launch!

AI can accelerate your development experience, and help you become more productive. That's why we introduced Gemini in Android Studio, your AI-powered coding companion. It’s designed to make it easier for you to build high quality Android apps, faster. Today, we're releasing the biggest set of updates to Gemini in Android Studio since launch, and now Gemini brings the power of AI to every stage of the development lifecycle, directly within the Android Studio IDE experience. And for more updates on how to grow your apps and games businesses, check out the latest updates from Google Play.

Download the latest version of Android Studio in the canary channel to take advantage of all these new features, and read on to unpack what's new.



Gemini Can Now Write, Refactor, and Document Android Code

Gemini goes beyond just guidance. It can edit your code, helping you quickly move from prototype to implementation, implement common design patterns, and refactor your code. Gemini also streamlines your workflow with features like documentation and commit message generation, allowing you to focus more time on writing code.

Moving image demonstrating Gemini writing code for an Android Composable in real time in Android Studio

Coding features we are launching include:

    • Gemini Code Transforms - modify and refactor code using custom prompts.

      using Gemini to modify code in Android Studio

    • Commit message generation - analyze changes and propose VCS commit messages to streamline version control operations.

      using Gemini to analyze changes and propose VCS commit messages in Android Studio

    • Rethink and Rename - generate intuitive names for your classes, methods, and variables. This can be invoked while you’re coding, or as a larger refactor action applied to existing code.

      using Gemini to generate intuitive names for variables while you're coding in Android Studio

    • Prompt library - save and manage your most frequently used prompts. You can quickly recall them when you need them.

      save your frequently used prompts for future use with Gemini in Android Studio

    • Generate documentation - get documentation for selected code snippets with a simple right click.

      generating code documation in Android Studio

Integrating AI into UI Tools

It’s never been easier to build with Compose now that we have integrated AI into Compose workflows. Composable previews help you visualize your composables during design time in Android Studio. We understand that manually crafting mock data for the preview parameters can be time-consuming. Gemini can now help auto-generate Composable previews with relevant context using AI, simplifying the process of visualizing your UI during development.

Visualize your composables during design time in Android Studio

We are continuing to experiment with Multimodal support to speed up your UI development cycle. Coming soon, we will allow for image attachment as context and utilizing Gemini's multimodal understanding to make it easier to create beautiful and engaging user interfaces.

Deploy with Confidence

Gemini's intelligence can help you release higher quality apps with greater confidence. Gemini can analyze, test code, and suggest fixes — and we are continuing to integrate AI into the IDE’s App Quality Insights tool window by helping you analyze crashes reported by Google Play Console and Firebase Crashlytics. Now, with Ladybug Feature Drop, you can generate deeper insights by using your local code context. This means that you will fix bugs faster and your users will see fewer crashes.

Generate insights using the IDE's App Quality Insights tool window

Some of the features we are launching include:

    • Unit test scenario generation generates unit test scenarios based on local code context.

    generate unit test scenarios based on local code context in Android Studio

      • Build / sync error insights now provides improved coverage for build and sync errors.

        build sync error insights are now avaiable in Android Studio

      • App Quality Insights explains and suggests fixes for observed crashes from Android Vitals and Firebase Crashlytics, and now allows you to use local code context for improved insights.

        save your frequently used prompts for future use with Gemini in Android Studio

    A better Gemini in Android Studio for you

    We recently surveyed many of you to see how AI-powered code completion has impacted your productivity, and 86% of respondents said they felt more productive. Please continue to provide feedback as you use Gemini in your day-to-day workflows. In fact, a few of you wanted to share some of your tips and tricks for how to get the most out of Gemini in Android Studio.



    Along with the Gemini Nano APIs that you can integrate with your own app, Android developers now have access to Google's leading edge AI technologies across every step of their development journey — with Gemini in Android Studio central to that developer experience.

    Get these new features in the latest versions of Android Studio

    These features are all available to try today in the Android Studio canary channel. We expect to release many of these features in the upcoming Ladybug Feature Drop, to be released in the stable channel in late December — with the rest to follow shortly after.

      • Gemini Code Transforms - Modify and refactor your code within the editor
      • Commit message generation - Automatically generate commit messages with Gemini
      • Rethink and Rename - Get help renaming your classes, methods, and variables
      • Prompt library - Save and recall your most commonly used prompts
      • Compose Preview Generation - Generate previews for your composables with Gemini
      • Generate documentation - Have Gemini help you document your code
      • Unit test scenario generation - Generate unit test scenarios
      • Build / sync error insights - Ask Gemini for help in troubleshooting build and sync errors
      • App Quality Insights - Insights on how you can fix crashes from Android Vitals and Firebase Crashlytics

    As always, Google is committed to the responsible use of AI. Android Studio won't send any of your source code to servers without your consent — which means you'll need to opt in to enable Gemini's developer assistance features in Android Studio. You can read more on Gemini in Android Studio's commitment to privacy.

    Try enabling Gemini in your project and tell us what you think on social media with #AndroidGeminiEra. We're excited to see how these enhancements help you build amazing apps!

    15 Things to know for Android developers at Google I/O

    Posted by Matthew McCullough, Vice President, Product Management, Android Developer  

    AI is unlocking experiences that were not even possible a few years ago, and we’ve been hard at work reimaging Android with AI at the core, to help enable you to build a whole new class of apps. At this year’s Google I/O, we’re covering how new tools like Gemini can power building the next generations of apps on Android. Plus, we showcased a range of updates to our tools and services grounded in productivity, helping you make it faster and easier to build excellent experiences across form factors. Let’s dive in!

    Powering the next generation of Apps with AI

    #1: AI in your tools, with Gemini in Android Studio

    Gemini in Android Studio (formerly Studio Bot) is your coding companion for Android development, and thanks to your feedback since its preview at last year’s Google I/O, we’ve evolved our models, expanded to over 200 countries and territories, and brought it into the Gemini family of products. Earlier today, we previewed a number of new features coming soon, like Code suggestions, App Quality Insights that leverage Gemini, and a preview of the multi-modal inputs that are coming using Gemini 1.5 Pro. You can read more about the updates here, and make sure to check out What’s new in Android development tools.

    #2: Building with Generative AI

    Android provides the solution you need to build Generative AI apps. You can use our most capable models over the Cloud with the Gemini API in Google AI or Vertex AI for Firebase directly in your Android apps. For on-device, Gemini Nano is our most efficient model. We’re working closely with a few early adopters such as Patreon, Grammarly, and Adobe to ensure we’re creating the best APIs that unlock the most innovative experiences. For example, Adobe is experimenting with Gemini Nano to enhance the on-device experience of Acrobat AI Assistant, a tool that allows their users to summarize and interact with documents. Be sure to check out the Build your own generative AI powered Android app, Android on-device gen AI under the hood, and the What’s New in Android sessions to learn more!

    Moving image of Gemini Nano operating in Adobe

    Excellent apps, across devices

    #3: Think adaptive: apps on phones, foldables, tablets and more

    Build and design apps that adapt beyond the phone, with the new Compose adaptive layout libraries built with Material guidance in beta. Add rich stylus and keyboard support to increase user productivity. Check out three of our key Android adaptive sessions at Google I/O: Designing adaptive apps, Building adaptive Android apps, and Increase user productivity with large screens and accessories.

    Moving image of Gemini Nano operating in Adobe

    #4: Enhance homescreens with Widgets and Jetpack Glance

    Jetpack Glance 1.1 is now available in release candidate and lets you build high quality widgets using your Compose skills. Check out our new canonical layouts, design guidance and figma updates to the Android UI kit. To learn more check out our Improve the user experience of your Android app workshop and Build Android widgets with Jetpack Glance technical session.

    #5-9: come back here tomorrow and Thursday!

    We’ll continue to share more updates for Android Developers throughout Google I/O, so check back here tomorrow!

    Developer Productivity

    #10: Use Kotlin Multiplatform for sharing business logic

    Kotlin Multiplatform (KMP) enables sharing Kotlin code across different platforms and several of our Jetpack libraries, like DataStore and Room, have already been migrated to take advantage of KMP. We use Kotlin Multiplatform within Google and recommend using KMP for sharing business logic between platforms. Learn more about it here.

    #11: Compose: Shared Elements, performance improvements and more

    The upcoming Compose June ‘24 release is packed with the features you’ve been asking for! Shared element transitions, lazy list item reordering animations, strong skipping mode, performance improvements, a new lazy flow layout and more. Read more about it in our blog.

    #12: Android Studio: the latest preview, with Gemini and more

    Android Studio Koala 🐨Feature Drop (2024.1.2) available today in the canary channel, builds on top of IntelliJ 2024.1 and adds new innovative features unlocked by Gemini, such as insights for crashes in App Quality Insights, code transformations and a Gemini API starter template to get you quickly started with Gemini. Additionally, new features such as USB speed detection, shortcut UI to control device settings, a new way to sign into Google services, updated and speedier UI for profilers with a new task centric approach and a deep integration with the Google Play SDK index are intended to make the development process extremely productive. Read more here.

    And the latest from the world of Mobile

    #13: Grow your business with the latest Google Play updates

    Discover new ways to attract and engage users with enhanced custom store listings. Optimize revenue with expanded payment options. Reinforce trust through secure, high-quality experiences made easier with our latest SDK Console improvements. Learn about these updates and more, including our new vertical approach, in our blog.

    #14: Simplify app compliance with Checks

    Streamline your app's privacy compliance with Checks, Google's AI-powered compliance solution! Checks empowers developers to swiftly identify, address, resolve privacy issues, and enables you to launch apps faster and with confidence. Harness the power of automation with Checks' intelligent reports, saving you valuable time and resources. Get started now at checks.google.com.

    #15: And of course, Android 15

    …but for that, you’ll have to stay tuned tomorrow, when we’ve got a bit more up our sleeve!

    Precise Improvements: How TikTok Enhanced its Video Social Experience on Android

    Posted by The Android Developer Relations team

    TL;DR


    TikTok serves a wide range of user groups. With users around the world, it’s inevitable that some of them experience network issues such as slow, intermittent, or expensive connectivity. Other users are using entry level devices with limited memory and storage. Ensuring an excellent app experience in all these scenarios is paramount. TikTok's team was able to significantly improve their overall performance by following Android’s performance guidance, and employing their deep understanding of development tools such as Android Gradle Plugin and Jetpack libraries. If you want to learn how the TikTok team improved their app experience to achieve better business performance, please read our business article here.

    Intro


    TikTok is one of the most popular community-driven entertainment platforms with 1 billion people across the globe publishing and browsing video content every day.

    A diverse user base naturally means diverse network bandwidth conditions and devices with different screen sizes, available memory and processing power. All users want a smooth, responsive app experience, no matter which device they use. If the app is slow to load, or playback gets stuck, users will feel frustrated and might abandon the app altogether. To avoid issues like these, the TikTok team continuously tracks the overall app performance through ongoing data monitoring, peer benchmarks, and user surveys.

    TikTok is constantly introducing new features. But a rapid increase in functionality sometimes leads to an upsurge in technical requirements. The engineering team identified three reasons that slowed down the app : janky frames, video playback lag, and network issues. To solve these issues, the TikTok team looked to Android tools to start their app improvement journey.

    From Discovery to Solution


    Reducing app startup time, a smoother user experience with reduced jank and better video playback experience were three major goals that the team prioritized. They also discussed how to measure the effects of performance optimization to prevent the occurrence of regression.

    1. Faster startup: refactor startup framework

    App startup time is one of the metrics in Android Vitals. Making sure the app startup time is no longer than the Android Vital’s recommendation is the best way to ensure the app loads and starts responding to user activity as quickly as possible. The App Startup library is an Android Jetpack library to help developers initialize app components simply and efficiently.

    The team studied the App Startup library in depth and refactored the app's startup framework to achieve on-demand loading and meticulous scheduling of components. In order to further reduce the execution time of creating Views on the main thread, the team even used a background thread to load View components asynchronously, thus improving the overall speed of app startup.

    TikTok used Simpleperf to analyze the code execution time, and Android Studio's Profiler to monitor the usage of resources such as memory, CPU, and network to optimize I/O, threads, and resource locks.

    2. Smoother user interface

    To ensure a smoother user interface, the team needed to tackle two challenges: 1) simplify the View hierarchy, so that the app only renders what is necessary on screen, and 2) reduce the number of task executions in each frame so that the app can have a steady frame rate.

    The TikTok team used the Layout Inspector in Android Studio to pinpoint the unnecessary layout contents. The layout boundaries of each View are clearly visible in the inspector, so the team can easily simplify the View hierarchy of the interface and reduce excessive and unnecessary content drawing.

    In many cases, TikTok used doFrame() to perform frame-by-frame tasks. Trying to fit too much work in a single frame will inevitably cause a jank. TikTok's approach was to use allocation algorithms to distribute tasks into different frames to ensure that the application has a steady frame rate.

    3. Better video playback experience: reuse resources

    TikTok users can create audio and video content in various ways, and different codecs are used to play different types of content. Android provides the MediaCodec class to help access the underlying codec. To further improve the speed of video playback, it is good practice to provide different media player instances for different codecs. The TikTok team created a pool of media player instances throughout the application to neatly provide for various media contents. They even run each media player instance in different threads to minimize interference between one another

    Network connection speed is another contributor to video lag . The team tested different solutions, including optimizing connections and reusing sockets, and developed algorithms to dynamically adjust buffer length when streaming content to reduce lag during playback.

    They also used on-device video super-resolution to generate high-resolution frames based on low-resolution video content, further improving the quality of video playback without increasing network pressure.

    Preloading (loading the next video ahead of time) and pre-rendering (rendering the first frame of the video ahead of time) are critical components to ensure that users have a smooth experience when playing multiple videos in succession. TikTok drew a Surface in advance only adding it into the screen when it is actually needed, to reduce the pressure of drawing it on the spot.

    4. Avoid regressions

    The team continues to maintain a detailed understanding of performance and works to fine-tune elements when necessary. Luckily, Android has tools in place for this exact purpose, like Systrace to capture traces so developers can export system activities (including CPU scheduling, disk activities, and app threads) for detailed analysis. The team also relies heavily on tools like Perfetto and Android Studio CPU profiler to track the execution time of various events, especially for I/O and class loading.

    Better Performance, Better Experience


    TikTok creatively leveraged the Android toolchain to track, quantify, and optimize their app’s performance for its business priorities, resulting in improved user experience and an increase in user satisfaction

    The app startup time was reduced by 45%, and the smoothness (the chance of the frame rate being lower than the target value) has been optimized by 49%. When playing a video, the first frame of the video appeared 41% faster, and the chance of video lag was reduced by 27%.

    Users are now more willing to use TikTok: active days per user in 30 days increased by 1%as did the average of session duration. User surveys and TikTok’s rating in Google Play also show a significant increase in user satisfaction.

    The Next Stage for TikTok


    By constantly optimizing app performance and adapting to the latest Android 13 platform, TikTok has created a more seamless app experience, encouraging more users to discover, create, and share the content they love.

    With more than 250 million active large-screen Android devices globally, the team has also been focusing on large-screen devices, including foldable devices. By adopting the app to large screens, the team has brought a more immersive experience to TikTok users.

    To learn more about how TikTok optimized its Android app to improve user experience and business performance, read the article here.

    Get Guidance on Performance


    To learn how you can get started to inspect, improve and monitor your app's performance visit our developer guide. The fastest way to improve your app's launch speed is by adding a baseline profile to your next release.