AI Prompt for Mobile Dev
Generate a complete Android feature module with Jetpack Compose UI, ViewModel, repository, and Hilt dependency injection.
More prompts for Mobile Dev.
Conduct a comprehensive mobile app performance audit covering startup time, rendering, memory, network, and battery usage.
Complete ASO strategy for a e-commerce app in the cybersecurity space to maximize downloads.
Implement the Feature-based modularization pattern in Jetpack Compose with practical code structure and examples.
Implement the Unidirectional data flow pattern in React Native + TypeScript with practical code structure and examples.
Complete ASO strategy for a language learning app in the travel space to maximize downloads.
Complete ASO strategy for a meditation app in the biotech space to maximize downloads.
You are a senior Android developer. Build a complete feature module following modern Android development best practices. Feature: [FEATURE_NAME] Description: [FEATURE_DESCRIPTION] Data source: [API_LOCAL_DB_BOTH] Navigation: [NAVIGATION_REQUIREMENTS] Generate the following with Jetpack Compose and Kotlin: 1. **Feature structure** -- Organize by clean architecture: - data/remote (API service interface, DTOs) - data/local (Room entities, DAO) - data/repository (Repository implementation) - domain/model (Domain models) - domain/usecase (Use cases) - presentation/screen (Compose screens) - presentation/viewmodel (ViewModels) - di/module (Hilt modules) 2. **Data layer** -- - Retrofit service interface with suspend functions - Room database entity and DAO - Repository implementation with offline-first logic - Data mapping between DTO, Entity, and Domain models 3. **Domain layer** -- - Domain models (clean, no framework dependencies) - Use cases with proper error handling using Result or Arrow Either - Repository interface definition 4. **Presentation layer** -- - Compose screen with proper state handling - ViewModel with StateFlow for UI state - UiState sealed class (Loading, Success, Error) - Event handling with Channel or SharedFlow - Pull-to-refresh, pagination if applicable 5. **Dependency injection** -- - Hilt module for all dependencies - Scoping (Singleton, ViewModelScoped) - Qualifier annotations if needed 6. **Testing** -- - ViewModel unit test with TestDispatcher - Repository test with fake data sources - Compose UI test with ComposeTestRule - Use case test with mock repository Output all Kotlin files with complete imports and annotations.
Replace the bracketed placeholders with your own context before running the prompt:
[FEATURE_NAME]— fill in your specific feature_name.[FEATURE_DESCRIPTION]— fill in your specific feature_description.[API_LOCAL_DB_BOTH]— fill in your specific api_local_db_both.[NAVIGATION_REQUIREMENTS]— fill in your specific navigation_requirements.