Android Studio uses Gemini Pro to make Android development faster and easier

Android Studio uses Gemini Pro to make Android development faster and easier


Posted by Sandhya Mohan – Product Manager, Android Studio

As part of the next chapter of our Gemini age, we announced this we brought Gemini to more products. Today we're proud to announce that Android Studio is using the Gemini 1.0 Pro model to make Android development faster and easier. We've seen significant improvements in response quality over the past few months through our internal testing. In addition, we are making this transition clearer by announcing that it is now called Studio Bot Twin in Android Studio.

Gemini in Android Studio is an AI-powered coding assistant that can be accessed directly in the IDE. It can boost your ability to develop high-quality Android apps faster by helping you generate code for your app, provide complex code completions, answer your questions, find relevant resources, add code comments, and more – all without ever having to leave Android Studio. It is available indoors 180+ countries and territories in Android Studio Jellyfish.

If you were already using Studio Bot in the Canary Channel, you will continue to experience the same useful and powerful features, but you will notice improved quality of responses compared to previous versions.

Ask Gemini your questions about Android development

Gemini in Android Studio can understand natural language, so you can ask development questions in your own words. You can enter your questions into the chat window, ranging from very simple and open-ended questions to specific issues you need help with.

Here are some examples of the types of questions it can answer:

    • How do I add camera support to my app?
    • When I use Compose, I need a login screen with the following: a username field, a password field, a 'Sign in' button, a 'Forgot your password?' clutch. I want the password field to obscure the entry.
    • What is the best way to get location on Android?
    • I have an 'orders' table with columns like 'order_id', 'customer_id', 'product_id', 'price' and 'order_date'. Can you help me write a query that calculates the average order value per customer over the past month?

Moving image demonstrating a conversation in Android Studio

Gemini in Android Studio remembers the context of the conversation, so you can also ask follow-up questions, such as “Can you give me the code for this in Kotlin?” or “Can you show me how to do it in Compose?”

Code faster with AI-powered code completions

Gemini in Android Studio can help you be more productive by providing you with powerful features AI code completions. You can receive suggestions for completing multi-line code, suggestions for commenting your code, or adding documentation to your code.

Animated image showing code completion in Android Studio

Designed with privacy in mind

Gemini in Android Studio is designed with privacy in mind. Gemini is only available after you are logged in and enabled. You don't need to submit your code context to take advantage of most of the features. By default, Gemini's chat responses in Android Studio are based purely on conversation history, and you decide whether to share additional context for custom responses. You can update this at any time in Android Studio > Detailed Project Level Settings. We also have a custom way for you to unsubscribe from certain files and folders via a .aiexclude file. Like our work on other AI projects, we adhere to a set of AI principles that hold us accountable. Learn more here.

image of sharing settings in Android Studio

Build a Genative AI app using the Gemini API starter template

Android Studio not only uses Gemini to help you be more productive, it can also help you take advantage of Gemini models to create AI-powered features in your applications. Get started in minutes with the Gemini API starter template available in the canary release – channel for Android Studio – below File > New Project > Gemini API Starter. You can also use the code sample available at File > Import Sample > Google Generative AI Sample.

The Gemini API is multimodal, meaning it can support image and text input. For example, it can support conversational chat, summaries, translations, caption generation, etc. using both text and image input.

image of starter templates in Android Studio

Try Gemini in Android Studio

Gemini in Android Studio is still in preview, but we've added many feature improvements (and now a major model update) since we released the experience in May 2023. It is currently free for developers to try out. Now's a good time to test it out and let us know what you think before we release this experience on stable.

Stay up to date with the latest news by following us LinkedIn, Medium, YouTubeor X. Let's build the future of Android apps together!