20 of the best prompts for Gemini for android, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
20 of the best prompts for Gemini for android, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
Published July 5, 2026
Write better Android code, use Jetpack components correctly, debug faster, and build apps that feel polished and performant. Built across 4 distinct stages covering Kotlin and Language, Jetpack and Architecture, Jetpack Compose and more, this guide gives you one expert prompt per step so you never have to write from scratch or guess what the AI needs. The prompts work in ChatGPT, Claude, and Gemini and are designed to get usable output on the first try.
Write idiomatic, modern Kotlin for Android.
Rewrite Java Android code
Rewrite this Java Android code in modern Kotlin: [PASTE CODE]. Use data classes, extension functions, null safety, and coroutines where appropriate.
Explain Android-specific example
Explain [DESCRIBE KOTLIN CONCEPT, E.G. "SEALED CLASSES", "FLOW VS LIVEDATA", "COROUTINE SCOPES"] with an Android-specific example. Show the common mistakes and how to avoid them.
Keep getting
I keep getting a NullPointerException in this Kotlin code: [PASTE CODE]. Explain why and show how to handle nullability correctly with Kotlin's type system.
Write Kotlin extension function
Write a Kotlin extension function that [DESCRIBE UTILITY]. Show how to use it across multiple activities or fragments.
When should I
When should I use a data class vs a sealed class vs an enum in Android? Show a real example from an Android app where each one is the right choice.
Use Jetpack components correctly and build maintainable Android architecture.
MVVM architecture
Set up MVVM architecture for [DESCRIBE FEATURE]. Show the ViewModel, Repository, and UI layer with proper separation of concerns and Kotlin coroutines.
Write nav graph setup
I need to manage [DESCRIBE NAVIGATION] in my app with Navigation Component. Write the nav graph setup, the fragment transitions, and how to pass arguments between destinations.
Write Room database setup
Write a Room database setup for [DESCRIBE DATA MODEL]: entity, DAO, database class, and a Repository that exposes data as Flow. Show how to query and insert data.
Implement Show the setup
Implement the [DESCRIBE JETPACK COMPONENT, E.G. "WORKMANAGER BACKGROUND TASK" OR "DATASTORE FOR PREFERENCES"]. Show the setup, the key configuration, and a usage example.
ViewModel is doing
My ViewModel is doing too much: [PASTE VIEWMODEL]. Refactor it using clean architecture principles, moving business logic to a use case layer and data operations to a repository.
Build modern Android UI with Compose.
Write Composable
Write a Composable for [DESCRIBE UI COMPONENT]. Make it reusable with proper parameters, preview annotations, and theming support.
Rewrite XML layout
I am moving from XML layouts to Jetpack Compose. Rewrite this XML layout as a Composable: [PASTE XML]. Explain the key differences.
Manage state
How do I manage state in this Compose screen: [DESCRIBE SCREEN AND STATE]. Compare remember, rememberSaveable, ViewModel state, and when to use each.
Write Compose navigation setup
Write the Compose navigation setup for an app with these screens: [LIST SCREENS]. Include the NavHost, composable routes, and how to navigate with arguments.
Compose screen is slow:
This Compose screen is slow: [DESCRIBE OR PASTE COMPOSABLE]. Identify what is causing unnecessary recompositions and how to fix it.
Find bugs faster and make your app faster.
App crashes
My app crashes with this error: [PASTE CRASH LOG AND RELEVANT CODE]. Walk me through the root cause and the fix.
App is slow
My app is slow on [DESCRIBE SCREEN OR ACTION, E.G. "A LONG LIST" OR "SWITCHING BETWEEN TABS"]. What profiling tools should I use and what are the most common causes of this type of slowness?
Memory leak
I have a memory leak in my Android app: [DESCRIBE SYMPTOMS]. How do I find it and what are the most common causes in Android apps?
Write Android instrumentation test
How do I write an Android instrumentation test for [DESCRIBE FEATURE]? Show the test setup, the UI interaction, and the assertions.
App uses too
My app uses too much battery. What are the most common causes of excessive battery drain in Android apps and how do I diagnose which one is affecting my app?
Yes. Gemini writes idiomatic Kotlin, helps set up Jetpack components, explains MVVM architecture, and assists with Jetpack Compose, covering the full modern Android development stack.
Gemini writes reusable Composables, helps migrate XML layouts to Compose, explains state management patterns, and identifies unnecessary recompositions causing performance issues.
Yes. Paste the crash log and relevant code and Gemini will walk through the root cause and the fix, and explain how to prevent the same class of error.
MVVM architecture, Room, Navigation Component, Jetpack Compose, WorkManager, Kotlin coroutines and Flow, and common debugging scenarios are all areas where Gemini gives accurate, practical guidance.
Yes. Describe the symptom and Gemini will suggest the right profiling approach, identify the most common causes for that type of issue, and guide you to the fix.
AI Prompts for Gemini for JavaScript
Write modern JavaScript and TypeScript, debug tricky browser and Node.js issues, and build cleaner frontend and backend code with Gemini..
See promptsAI Prompts for Gemini for React
Build clean React components, write reusable hooks, fix performance issues, and ship production-quality UI with Gemini as your coding partner..
See promptsAI Prompts for Gemini for Coding
Gemini is a strong coding assistant with particularly deep integration into Google's development ecosystem: Firebase, Google Cloud, Android Studio, and Google APIs.
See prompts