Learn how to implement MVP vs MVVM in an Android project by comparing both patterns in the same codebase
See how to use Dagger for dependency injection with application-scoped and activity-scoped objects
Understand how to support multiple screen sizes and pixel densities using Android resource qualifiers
Study how to structure navigation and data passing between fragments inside a single activity
Code targets 2014 Android practices, some dependencies may need updating to compile cleanly in modern Android Studio.
EffectiveAndroidUI is a sample Android application created as a companion to the talk and slides of the same name by Pedro Vicente Gomez Sanchez. Its purpose is to show patterns and techniques for building the user interface layer of Android apps, with working code rather than abstract descriptions. The app demonstrates two architectural patterns for organizing UI code: MVP (Model-View-Presenter) and MVVM (Model-View-ViewModel without a data binding engine). Seeing both in the same project makes it easier to compare how each pattern separates concerns differently. The project also shows how to use fragments, how to pass data between fragments in the same activity, and how to organize navigation using Navigator and ActionCommands patterns. A key theme throughout the project is the use of Android resource qualifiers. The code shows how to provide different layouts for different screen sizes, different screen pixel densities, and different versions of Android, all using the same folder-naming convention Android already supports. This means the app adjusts its layout for phones and tablets without writing platform-version checks in code. The project uses Dagger for dependency injection, demonstrating two different scopes: one for objects that live for the entire application lifetime and one for objects that live only as long as a single Activity. Other libraries used include Butterknife for view binding, Picasso for image loading, Renderers for ListView adapter patterns, and DraggablePanel for a draggable side panel. The code was written in 2014 and targets older Android practices, but the core architectural ideas it demonstrates remain useful as reference material. It is licensed under Apache 2.0.
← pedrovgs on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.