explaingit

pedrovgs/effectiveandroidui

5,989JavaAudience · developerComplexity · 2/5LicenseSetup · moderate

TLDR

A sample Android app demonstrating MVP and MVVM architecture patterns side by side, plus Dagger dependency injection, resource qualifiers for multiple screen sizes, and fragment navigation, reference code from a conference talk on Android UI best practices.

Mindmap

mindmap
  root((EffectiveAndroidUI))
    Architecture patterns
      MVP
      MVVM
    UI patterns
      Fragment navigation
      Resource qualifiers
      Phone and tablet layouts
    Libraries used
      Dagger injection
      Picasso images
      Butterknife binding
    Learning goals
      Separation of concerns
      Dependency scopes
      UI organization
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Learn how to implement MVP vs MVVM in an Android project by comparing both patterns in the same codebase

USE CASE 2

See how to use Dagger for dependency injection with application-scoped and activity-scoped objects

USE CASE 3

Understand how to support multiple screen sizes and pixel densities using Android resource qualifiers

USE CASE 4

Study how to structure navigation and data passing between fragments inside a single activity

Tech stack

JavaAndroidDaggerPicassoButterknifeGradle

Getting it running

Difficulty · moderate Time to first run · 30min

Code targets 2014 Android practices, some dependencies may need updating to compile cleanly in modern Android Studio.

Use freely for any purpose, including commercial use, as long as you keep the Apache 2.0 license notice.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me the MVP pattern used in EffectiveAndroidUI and explain how the Presenter keeps business logic out of the View
Prompt 2
How does this project use Dagger to inject different-scoped dependencies into Activities vs the whole Application?
Prompt 3
Generate an Android Fragment that follows the Navigator pattern from this codebase to navigate to a detail screen
Prompt 4
Explain the difference between the MVP and MVVM implementations in this repo, when would I choose one over the other?
Prompt 5
How does EffectiveAndroidUI handle different tablet vs phone layouts using resource qualifiers without writing version checks in code?
Open on GitHub → Explain another repo

← pedrovgs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.