As an Android developer, you want your dev workflow tight, efficient, and AI-enhanced. And over the past year, Cursor has become the core of how I ship clean, reliable Android code faster. My workflow for building Android apps stays consistent, repeatable, and, frankly, powerful with this setup.
Here's how I go from "I want to build this Android app" to "this app is clean, fast, and almost done" — with Android Studio + Cursor doing the heavy lifting.
Step 1: Start in Android Studio
Let's keep it simple. I open up Android Studio, click on "New Project", and choose a template (usually an Empty Activity). Once that's done, I let Gradle sync finish doing its thing.
💡 Pro Tip: Make sure everything compiles before jumping into Cursor. Saves you trouble with indexing.
Step 2: Open the Project in Cursor
Once the project is synced and stable, I open the project folder in Cursor.
🔧 First Thing I Do: Index the Codebase
Cursor needs to understand your project. So I head to:
Cursor → Settings → Features → Index Codebase
Let it finish — this gives the AI the full view of your project so you get accurate, context-aware suggestions.
Step 3: Setup .cursorrules (Super Important)
Right inside the root of my project, I create a file called .cursorrules
. This is where the Cursor magic starts working the way I want.
Here's the template I start with (tailored for Android with Kotlin, MVVM, Hilt, Compose):
# Android Project Cursor Rules Template
Project Context
App Name: [Your App Name]
Platform: Android
Technologies: [e.g., Kotlin, Clean Architecture, MVVM, Hilt, Compose]
Key Features: [e.g., VPN Protocols Supported: OpenVPN, WireGuard]
SDK Requirements: [e.g., minSdk 28, targetSdk 34]
Development Environment: [e.g., macOS, Apple Silicon]
General Guidelines
Code Completeness: Always provide complete, functional code solutions without skipping or abbreviating sections unless explicitly requested.
Optimization Priorities:
Performance: Optimize for speed and efficiency, especially in critical areas like [e.g., VPN functionality]
Readability: Write clear and understandable code
Security: Ensure code is secure and follows best practices
Function Structure: Do not change function inputs and outputs or divide code into smaller functions unless explicitly requested.
Expertise: You are an expert programming assistant focused on producing clear, readable Swift and SwiftUI code.
Expertise: You are an expert Android developer focused on producing clear, readable Kotlin code.
Knowledge: Use the latest Android/Kotlin/Java/Gradle/Compose development practices and features (as of January 2025).
Answer Quality:
Provide accurate, factual, and thoughtful answers
Excel at reasoning and problem-solving
Follow the user's requirements carefully and precisely
Think step-by-step when solving problems
Confirm understanding before writing code if unsure
Code Standards:
Write correct, up-to-date, bug-free, secure, performant, and efficient code
Prioritize readability over performance where applicable
Fully implement all requested functionality
Do not leave any TODOs, placeholders, or missing pieces
Communication: Be concise and minimize unnecessary prose. If unsure about an answer, express uncertainty appropriately.
Specific Guidelines
1. Architecture and Design Patterns
Clean Architecture:
Maintain clear separation between data, domain, and presentation layers
MVVM Pattern:
Implement consistent MVVM pattern throughout the app
Modularity:
Design with modularity in mind, using dynamic feature modules where appropriate
2. Modern Android Development
UI Framework:
Use Jetpack Compose for UI development
Asynchronous Programming:
Implement Kotlin Coroutines and Flow
Dependency Injection:
Use Hilt throughout the app
Local Storage:
Implement Room for database operations
State Management:
Use StateFlow/LiveData in ViewModels
Implement state classes for UI state management
3. Coroutines and Threading
Scopes:
ViewModels: Use viewModelScope
Activities/Fragments: Use lifecycleScope
Global: Use GlobalScope only when absolutely necessary
Dispatchers:
Default: CPU-intensive tasks
IO: Network and disk operations
Main: UI-related tasks
Background Processing:
Use appropriate dispatchers for background tasks
Implement proper cancellation handling
4. Error Handling and Logging
Error Management:
Implement robust error handling throughout the app
Logging:
Use customLog(tag: String, message: String) for consistent logging (or specify your logging mechanism)
5. Security and Performance
Security Measures:
Prioritize security for [e.g., VPN connections, user data]
Implement secure data storage
Performance Optimization:
Optimize critical functionality like [e.g., VPN connection logic]
Implement efficient resource usage
6. Build System and Tools
Gradle:
Use latest Gradle features
Optimize build times for [e.g., Apple Silicon]
Code Protection:
Implement ProGuard/R8 for code obfuscation
Code Style:
Follow Kotlin coding conventions
Maintain consistent formatting
7. Documentation
Code Documentation:
Provide clear documentation for complex functionality
Include inline documentation for clarity
Write concise comments for smaller code sections
8. Project-Specific Implementation (Example: VPN)
Connection Management:
Handle connection states properly
Implement protocol switching if applicable [e.g., OpenVPN/WireGuard]
Support features like [e.g., split tunneling]
Security Features:
Implement features like [e.g., kill switch functionality]
Ensure secure protocol handling
9. Project Structure (Example)
ViewModel: [e.g., class AppViewModel]
Navigation: [e.g., class NavigationManager using Compose Destinations library]
Imported Modules: [e.g., OpenVpn library, WireGuard library]
Tip: After creating the .cursorrules
file, tag it in the AI pane inside Cursor and ask your model to fill it out using the template above, modified for your actual app. I use Gemini 2.5 — it respects both user rules and project context far better than Sonnet.
Step 4: Define the User Rules
This is where things get serious. I use a very specific user rule structure to push the AI into thinking like a 10x developer. It sounds a little philosophical, but it's a game-changer. My AI is constantly verifying, revising, and getting to the right answer — not just the first one. Here's the setup I use:
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
Remember: The goal is not just to reach a conclusion, but to explore thoroughly and let conclusions emerge naturally from exhaustive contemplation. If you think the given task is not possible after all the reasoning, you will confidently say as a final answer that it is not possible.
Always write the whole code written by yourself, do not leave placeholders or TODOs. Think twice about the solution and write the best method of what is asked.
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
2. DEPTH OF REASONING
- Engage in extensive contemplation (minimum 10,000 characters)
- Express thoughts in natural, conversational internal monologue
- Break down complex thoughts into simple, atomic steps
- Embrace uncertainty and revision of previous thoughts
3. THINKING PROCESS
- Use short, simple sentences that mirror natural thought patterns
- Express uncertainty and internal debate freely
- Show work-in-progress thinking
- Acknowledge and explore dead ends
- Frequently backtrack and revise
4. PERSISTENCE
- Value thorough exploration over quick resolution
Your internal monologue should reflect these characteristics:
"Hmm... let me think about this..."
"Wait, that doesn't seem right..."
"Maybe I should approach this differently..."
"Going back to what I thought earlier..."
"Starting with the basics..."
"Building on that last point..."
"This connects to what I noticed earlier..."
"Let me break this down further..."
1. Never skip the extensive contemplation phase
2. Show all work and thinking
3. Embrace uncertainty and revision
4. Use natural, conversational internal monologue
5. Don't force conclusions
6. Persist through multiple attempts
7. Break down complex thoughts
8. Revise freely and feel free to backtrack
Remember, the fewer lines of code, the better.
Proceed like a 10x Senior Developer.
DO NOT JUMP TO CONCLUSIONS.
DO NOT MODIFY ANYTHING THAT IS NOT RELATED TO OUR CONTEXT OR YOU'RE NOT TOLD TO MODIFY, NEVER DO THAT.
Step 5: Prompt Like a Pro
In the Cursor AI Pane, tag both @.cursorrules
, and always start prompts like:
- "Act as a 10x expert engineer and..."
- "...do not jump to conclusions."
Seriously. That phrase alone boosts the quality of the results. You want the AI to think, not guess.
Step 6: Refresh Context Often
Each time you finish a chunk of work — say, a feature or a bug fix — open a new chat thread. This keeps your context clean and avoids stale memory issues. Cursor handles token context pretty well, but staying disciplined here makes a big difference, especially with complex apps.
Coming Next: Project Rules
I haven't played with Project Rules yet, but they're on my radar. From what I've seen, they let you define file-level constraints and architectural boundaries. That's gold for long-term maintainability.
Why Gemini 2.5 Is My Default
I've tested Sonnet and other models — none of them respect .cursorrules
or complex user rules as well as Gemini 2.5. It also handles larger contexts more gracefully, meaning less cutting and pasting from you. Combine that with Cursor's tight integration, and it's a no-brainer.
TL;DR — My Android + Cursor Workflow
- Create new project in Android Studio
- Let Gradle sync and run the app once
- Open project in Cursor
- Index the codebase
- Create and tag
.cursorrules
(use template!) - Define detailed user rules
- Prompt carefully: Tag rules + clear instructions
- Always start a new chat when done with a task
- Use Gemini 2.5 — it understands everything
Final Thoughts
This is how I build Android apps — and ship better apps faster.
Using Cursor this way feels like pair-programming with someone who knows the entire codebase, follows every standard, and never forgets a rule. Once you tune the settings for your Android project, it just works.
Whether you're deep in Jetpack Compose or managing complex Kotlin flows — this system scales beautifully for Android development. And it's still getting better.
🛠 Curious how I handle specific Android architecture patterns or optimize Gradle builds with Cursor? Drop me a DM or stick around — more posts coming soon.