Gemini in Android Studio streamlines your workflow and makes it easier to keep your code organized with AI-powered refactoring and documentation features.
Generate documentation
You can use Gemini in Android Studio to generate documentation for your code. Generate clear and concise documentation for your code with instant drafts that you can refine and perfect.
- Select a code snippet and right-click in the code editor and select Gemini > Document Function from the context menu. (You may also see Document Class… or Document Property… depending on the context.)
- Review proposed changes and refine if necessary before you click Accept changes.
Rename with Gemini
When using the standard Refactor > Rename action renaming variables, classes, and methods, Gemini suggests appropriate names based on the code context.
Rethink variable names
Gemini can suggest names for all variables or methods in a file based on the code context, so that names are more intuitive and descriptive. Right-click in the code editor and select Gemini > Rethink variable names. A dialog appears where you can review the suggested names and accept only the ones you like.
Suggest commit message
When committing changes to your version control system from the IDE, Gemini can use the context from the code changes in the current commit and recent past commits to suggest a detailed commit message. To generate a commit message, click the Suggest commit message button above the text input field in the Commit tool window.