android-java
Android Java development with MVVM, ViewBinding, and Espresso testing
By alinaqi · 650 installs
npx skills add alinaqi/maggy --skill android-java
Source repository · Upstream listing
Android Java Skill
Project Structure
Gradle Configuration
App level build.gradle
Architecture Patterns
MVVM with ViewModel
Repository Pattern
Activity & Fragment Patterns
Activity with ViewBinding
Fragment with ViewBinding
Testing
Unit Tests with JUnit & Mockito
Instrumentation Tests with Espresso
GitHub Actions
Lint Configuration
lint.xml
build.gradle lint options
Common Patterns
Null Safe Callbacks
Safe Context Usage
Thread Safe Singleton
Android Anti Patterns
❌ Context leaks Never hold Activity/Fragment references in static fields or singletons
❌ Memory leaks in callbacks Always use WeakReference or clear callbacks in onDestroy
❌ UI updates on background thread Always post to main thread for UI changes
❌ Hardcoded strings Use string resources for all user visible text
❌ God Activities Keep Activities under 200 lines, extract logic to ViewModels
❌ NetworkOnMainThreadException Never perform network calls on main thread
❌ Ignoring lifecycle Always respect Activity/Fragment lifecycle states
❌ Blocking the main thread Keep main thread operations under 16ms
❌ Not handling configuration changes Use ViewModel to survive rotation
❌ Hardcoded dimensions Use dp/sp units and dimension resources
❌ Deep view hierarchies Keep layout depth under 10 levels, use ConstraintLayout
❌ Not closing resources Always close Cursor, InputStream, database connections