[ Web Proxy ]
URL:
Viewing: https://developer.android.com/studio/gemini/code-transformation [Back]  [Original]

Transform code  |  Android Studio  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]

Transform code Stay organized with collections Save and categorize content based on your preferences.

You can prompt Gemini from the code editor for code suggestions to modify, optimize, or add code to your app as follows:

  1. To get the prompt input field, do one of the following from the code editor:
    • Right-click in the code editor and select Gemini > Generate code from the context menu.
    • Highlight code that you want Gemini to modify, right-click in the code editor, and select Gemini > Transform code from the context menu.
    • Press CTRL+\ (Command+\ on macOS).
  2. Prompt Gemini by describing how you want to modify or add to your code and press Enter. After Gemini processes your request, you should see a code diff. With the code diff, you can review and accept only the suggestions you want.
  3. Review the code diff and do one of the following:

    • Further modify the suggested code by clicking Refine and entering a new prompt.
    • Click Accept Changes to add the suggested changes to your code.

Things to try:

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-03-06 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-06 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page