Android :: Simplified
Modern Android applications can be developed in a simple and easy way by using Android Architecture Components. Unfortunately, most of the guides, tutorials, and samples around the web usually include very simple use-case scenarios and do not address the intricacies and complexities of actual real Android apps.
Para la versión en español, presionar aquí
Objectives
Simple architecture to support any requirements (simple and complex)
Minimize dependencies on external libraries
Modular design to promote reusability and avoid spaghetti-code
Architecture Fundamentals
Good architecture provides structure, making the whole project easier to develop, debug, and test. This also facilitates maintenance and support activities, and most importantly: makes the whole project fun to work with.
Use Kotlin as primary programming language ➟ imposes architectural patterns for aynchronous calls (coroutines)
Fully rely on Android Navigation Component
Use Material Design for all UX design
Use of ViewBinding and DataBinding, isolating Fragments from any UI related tasks
Take advantage of Lifecycle-aware components
Data synchronization and offline support with Room persistence library
Use of json-server for all API endpoints ➟ to simplify development
The Hollywood Principle
"Don't call us, we'll call you"
Inversion of Control outlines principles for modular design, where the framework defines how the overall system works, facilitating SoC (separation of concerns)
Specialization: each module does what it must do ➟ no more, no less
Encapsulation: details about implementation from other layers are properly encapsulated
Coupling: prevents "collateral damage" when changing other modules
In Android we can achieve this in several major components:
Lifecycle-aware components
Bindings
Navigation
Project Structure
Disclaimer: You are free to use SimpleAndroid repository at your own risk.
Content organized within Navigation Graphs
Activity (or even a Fragment) will contain Navigation Controller
Dummy Fragments used only to glue all other components together
UX policies to enforce main UI requirements
Toolbars (top, bottom, drawer, ...)
Branch organization
feature-branches contain code that is still under development
develop-branch contains stable code that may be final
master-branch is ready for prime-time
Articles
Representing UI state using ViewModel and Repository
UX Policies - Part 1: The Problem
UX Policies - Part 2: The UX Patterns
UX Policies - Part 3: The Implementation
Dynamic Content
A series of articles explaining why a dynamic approach could solve a lot of problems when developing native mobile-apps.