APPS

Android Developers Blog: Android Studio Narwhal Feature Drop is stable



Posted by Paris Hsu – Product Manager, Android Studio

The next wave of innovation is here with Android Studio Narwhal Feature Drop. We’re thrilled to announce that Gemini in Android Studio’s Agent Mode is now available in the stable release, ready to tackle your most complex coding challenges. This release also brings powerful new tools for XR development, continued quality improvements, and key updates to enhance your productivity and help you build high-quality apps.

Dive in to learn more about all the updates and new features designed to supercharge your workflow.

moving image of Gemini in Android Studio: Agent Mode

Gemini in Android Studio: Agent Mode

Develop with Gemini

Try out Agent Mode

Go beyond chat and assign tasks to Gemini. Gemini in Android Studio’s Agent Mode is a powerful AI feature designed to handle complex, multi-stage development tasks. To use Agent Mode, click Gemini in the sidebar and then select the Agent tab. You can describe a high-level goal, like adding a new feature, generating comprehensive unit tests, or fixing a nuanced bug.

The agent analyzes your request, breaks it down into smaller steps, and formulates an execution plan that uses IDE tools, such as reading and writing files and performing Gradle tasks, and can span multiple files in your project. It then iteratively suggests code changes, and you’re always in control—you can review, accept, or reject the proposed changes and ask the agent to iterate based on your feedback. Let the agent handle the heavy lifting while you focus on the bigger picture.

After releasing Agent Mode to Canary, we had positive feedback from the developers who tried it. We were so excited about the feature’s potential, we moved it to the stable channel faster than ever before, so that you can get your hands on it. Try it out and let us know what you build.

screen grab of Gemini's Agent Mode in Android Studio

Gemini in Android Studio: Agent Mode

Currently, the default model offered in the free tier in Android Studio has a shorter context length, which can limit the depth of response from some agent questions and tasks. In order to get the best performance from Agent Mode, you can bring your own key for the public Gemini API. Once you add your Gemini API key with a paid GCP project, you’ll then be able to use the latest Gemini 2.5 Pro with a full 1M context window from Android Studio. Remember to pick the “Gemini 2.5 Pro” from the model picker in the chat and agent input boxes.

screen grab of Gemini's model selector in Android Studio

Gemini in Android Studio: model selector

Rules in prompt library

Tailor the response from Gemini to fit your project’s specific needs with Rules in the prompt library. You can define preferred coding styles, tech stacks, languages, or output formats to help Gemini understand your project standards for more accurate and personalized code assistance. You can set these preferences once, and they’ll be automatically applied to all subsequent prompts sent to Gemini. For example, you can create a rule such as, “Always provide concise responses in Kotlin using Jetpack Compose.” You can also set rules at the IDE level for personal use across projects, or at the project level, which can be shared with teammates by adding the .idea folder to your version control system.

screen grab of Rules in Prompt Library in Android Studio

Rules in prompt library

Transform UI with Gemini [Studio Labs]

You can now transform UI code within the Compose Preview environment using natural language, directly in the preview. This experimental feature, available through Studio Labs, speeds up UI development by letting you iterate with simple text commands. To use it, right-click in the Compose Preview and select Transform UI With Gemini. Then enter your natural language requests, such as “Center align these buttons,” to guide Gemini in adjusting your layout or styling, or select specific UI elements in the preview for better context. Gemini will then edit your Compose UI code in place, which you can review and approve.

side by side screen captures of accessing the 'Transform UI with Gemini' menu on the left, and applying a natural language transformationto a Compose preview on the right in Android Studio

Immersive development

XR Android Emulator and template

Kickstart your extended reality development! Android Studio now includes:

    • XR Android Emulator: The XR Android Emulator now launches embedded within the IDE by default. You can deploy your Jetpack app, navigate the 3D space, and use the Embedded Layout Inspector directly inside Android Studio.
    • XR template: Get a head start on your next project with a new template specifically designed for Jetpack XR. This provides a solid foundation with boilerplate code to begin your immersive experience development journey right away.

XR Android Emulator in Android Studio

XR Android Emulator

XR Android Emulator in Android Studio

XR Android template in new project template

Embedded Layout Inspector for XR

The embedded Layout Inspector now supports XR applications, which lets you inspect and optimize your UI layouts within the XR environment. Get detailed insights into your app’s component structure and identify potential layout issues to create more polished and performant experiences.

Embedded Layout Inspector for XR in Android Studio

Embedded Layout Inspector for XR

Android Partner Device Labs available with Android Device Streaming

Android Partner Device Labs are device labs operated by Google OEM partners, such as Samsung, Xiaomi, OPPO, OnePlus, vivo, and others, and expand the selection of devices available in Android Device Streaming. To learn more, see Connect to Android Partner Device Labs.

Embedded Layout Inspector for XR in Android Studio

Android Device Streaming supports Android Partner Device Labs

Optimize and refine

Jetpack Compose preview quality improvements

We’ve made several enhancements to Compose previews to make UI iteration faster and more intuitive:

    • Improved code navigation: You can now click on a preview’s name to instantly jump to its @Preview definition, or click an individual component within the preview to navigate directly to the function where it’s defined. Hover states and improved keyboard arrow navigation make moving through multiple previews a breeze.
    • Preview picker: The new Compose preview picker is now available. You can click any @Preview annotation in your Compose code to access the picker and easily manage your previews.

improved code navigation in Compose preview in Android Studio

Compose preview: Improved code navigation

Compose preview picker in Android Studio

Compose preview picker

K2 mode by default

Android Studio now uses the K2 Kotlin compiler by default. This next-generation compiler brings significant performance improvements to the IDE and your builds. By enabling K2, we are paving the way for future Kotlin programming language features and an even faster, more robust development experience in Kotlin.

K2 mode setting in Android Studio

K2 mode setting

16 KB page size support

To help you prepare for the future of Android hardware, this release adds improved support for transitioning to 16 KB page sizes. Android Studio now offers proactive warnings when building apps that are incompatible with 16 KB devices. You can use the APK Analyzer to identify which specific libraries in your project are incompatible. Lint checks also highlight the native libraries which are not 16 KB aligned. To test your app in this new environment, a dedicated 16 KB emulator target is also available in the AVD Manager.

16 KB page size support: APK Analyzer indication

16 KB page size support: APK Analyzer indication

16 KB page size support: APK Analyzer indication

16 KB page size support: Lint checks

Services compatibility policy

Android Studio offers service integrations that help you and your team make faster progress as you develop, release, and maintain Android apps. Services are constantly evolving and may become incompatible with older versions of Android Studio. Therefore, we are introducing a policy where features that depend on a Google Cloud service are supported for approximately a year in each version of Android Studio. The IDE will notify you when the current version is within 30 days of becoming incompatible so you can update it.

Example notification for services compatibility policy in Android Studio

Example notification for services compatibility policy

Summary

To recap, Android Studio Narwhal Feature Drop includes the following enhancements and features:

Develop with Gemini

    • Gemini in Android Studio: agent mode: use Gemini for tackling complex, multi-step coding tasks.
    • Rules in Prompt Library: Customize Gemini’s output for your project’s standards.
    • Transform preview with Gemini [Studio Labs]: Use natural language to iterate on Compose UI.

Immersive development

    • Embedded XR Android Emulator: Test and debug XR apps directly within the IDE.
    • XR template: A new project template to kickstart XR development.
    • Embedded Layout Inspector for XR: Debug and optimize your UI in an XR environment.
    • Android Partner Device Labs available with Android Device Streaming: access more Google OEM partner devices.

Optimize and refine

    • Compose preview improvements: Better navigation and a new picker for a smoother workflow.
    • K2 mode by default: Faster performance with the next-gen Kotlin compiler.
    • 16KB page size support: Lint warnings, analysis, and an emulator to prepare for new devices.
    • Services compatibility policy: Stay up-to-date for access to integrated Google services.

Get started

Ready to accelerate your development? Download Android Studio Narwhal Feature Drop and start exploring these powerful new features today! As always, your feedback is crucial to us.

Check known issues, report bugs, suggest improvements, and be part of our vibrant community on LinkedIn Medium, YouTube, or X. Let’s build the future of Android apps together!





Source link

MarylandDigitalNews.com