Get answers from Gemini

The main interface for interacting with Gemini is the chat window. You can use it to ask questions ranging from very simple and open-ended ones to specific problems that you need help with.

Here are some examples of things you might ask; however, feel free to experiment with any topics related to Android development:

  • How do I add camera support to my app?
  • I want to create a Room database.
  • Can you remind me of the format for Javadocs?
  • What is dark theme?
  • What's the best way to get location on Android?

Gemini remembers the context of the conversation, so you can also ask it follow-up questions, such as:

  • Can you give me the code for this in Kotlin?
  • Can you show me how to do it in Compose?

You can also ask Gemini about a specific capability or workflow in Android Studio, for example:

  • How do I analyze jank in my app?
  • Where do I find the CPU profiler?

Tips for engaging with Gemini

Gemini's answers differ based on how you ask your question. Here are some tips on how to optimize the answers from Gemini:

  • Be specific. If there are certain libraries, APIs, or approaches that you'd like to use, include them in your question.
    How do I add camera support to my app using CameraX?
    How do I add camera support to my app?
  • Describe the structure of the desired answer. If you want to insert code generated by Gemini into your app and need it in a certain format, give it those instructions.
    Insert comments into this code. Use double slashes for the comments, and put each comment above the line of code it describes.
    Write code comments for this code.
  • Break up complex requests into a series of simpler questions. Especially when you're asking for code, asking a series of simpler questions yields a more comprehensive answer overall.
    1. Give me the MainActivity.kt file for an app with a login screen.
    2. Can you add a class that represents a user profile?
    3. Can you add code that supports multiple user profiles?
    How do I create an app with a login screen that supports multiple user profiles?

Prompt Library

Use the Prompt Library to save and manage your frequently used prompts and quickly recall them when needed. Access the Prompt Library from Settings > Gemini > Prompt Library to store and retrieve prompts. You can also right-click on a prompt in chat to save it for later use. To apply a saved prompt, right-click in the Editor and navigate to Gemini > Prompt Library to apply the prompt. This streamlined workflow eliminates the need to retype commonly used prompts, saving you time and effort.

Gemini prompt library tool