|
1 |
| -todo |
| 1 | +# Android Architecture Blueprints v2 |
| 2 | +<p align="center"> |
| 3 | +<img src="https://github.com/googlesamples/android-architecture/wiki/images/aab-logov2.png" alt="Android Architecture Blueprints"/> |
| 4 | +</p> |
2 | 5 |
|
| 6 | +Android Architecture Blueprints is a project to showcase different architectural approaches to developing Android apps. In its different branches you'll find the same app (a TODO app) implemented with small differences. |
| 7 | + |
| 8 | +In this branch you'll find: |
| 9 | +* Kotlin **[Coroutines](https://kotlinlang.org/docs/reference/coroutines-overview.html)** for background operations. |
| 10 | +* A single-activity architecture, using the **[Navigation component](https://developer.android.com/guide/navigation/navigation-getting-started)** to manage fragment operations. |
| 11 | +* A presentation layer that contains a fragment (View) and a **ViewModel** per screen (or feature). |
| 12 | +* Reactive UIs using **LiveData** observables and **Data Binding**. |
| 13 | +* A **data layer** with a repository and two data sources (local using Room and remote) that are queried with one-shot operations (no listeners or data streams). |
| 14 | +* Two **product flavors**, `mock` and `prod`, [to ease development and testing](https://android-developers.googleblog.com/2015/12/leveraging-product-flavors-in-android.html) (except in the Dagger branch). |
| 15 | +* A collection of unit, integration and e2e **tests**, including "shared" tests that can be run on emulator/device or Robolectric. |
| 16 | + |
| 17 | +## Variations |
| 18 | + |
| 19 | +This project hosts each sample app in separate repository branches. For more information, see the `README.md` file in each branch. |
| 20 | + |
| 21 | +### Stable samples - Kotlin |
| 22 | +| Sample | Description | |
| 23 | +| ------------- | ------------- | |
| 24 | +| [master](https://github.com/googlesamples/android-architecture/tree/master) | The base for the rest of the branches. Uses Kotlin, Architecture Components, coroutines, Data Binding, etc. | |
| 25 | +| [dagger-android](https://github.com/googlesamples/android-architecture/tree/dagger-android) | A simple Dagger setup that uses `dagger-android` and removes the two flavors. | |
| 26 | +| [usecases](https://github.com/googlesamples/android-architecture/tree/usecases) | Adds a new domain layer that uses UseCases for business logic. | |
| 27 | + |
| 28 | +### Samples in development - Kotlin |
| 29 | + |
| 30 | +| Sample | Description | |
| 31 | +| ------------- | ------------- | |
| 32 | +| [reactive](https://github.com/googlesamples/android-architecture/tree/reactive) | Modifies the data layer so UIs react to changes automatically using Room as source of truth. | |
| 33 | + |
| 34 | +### Old samples - Kotlin and Java |
| 35 | + |
| 36 | +Blueprints v1 had a collection of samples that are not maintained anymore, but can still be useful. See [all project branches](https://github.com/googlesamples/android-architecture/branches). |
| 37 | + |
| 38 | +## Why a to-do app? |
| 39 | + |
| 40 | +<img align="right" src="https://github.com/googlesamples/android-architecture/wiki/images/todoapp.gif" alt="A demo illustraating the UI of the app" width="288" height="512" style="display: inline; float: right"/> |
| 41 | + |
| 42 | +The app in this project aims to be simple enough that you can understand it quickly, but complex enough to showcase difficult design decisions and testing scenarios. For more information, see the [app's specification](https://github.com/googlesamples/android-architecture/wiki/To-do-app-specification). |
| 43 | + |
| 44 | +## What is it not? |
| 45 | + |
| 46 | +* A UI/Material Design sample. The interface of the app is deliberately kept simple to focus on architecture. Check out [Plaid](https://github.com/android/plaid) instead. |
| 47 | +* A complete Jetpack sample covering all libraries. Check out [Android Sunflower](https://github.com/googlesamples/android-sunflower) or the advanced [Github Browser Sample](https://github.com/googlesamples/android-architecture-components/tree/master/GithubBrowserSample) instead. |
| 48 | +* A real production app with network access, user authentication, etc. Check out the [Google I/O app](https://github.com/google/iosched), [Santa Tracker](https://github.com/google/santa-tracker-android) or [Tivi](https://github.com/chrisbanes/tivi) for that. |
| 49 | + |
| 50 | +## Who is it for? |
| 51 | + |
| 52 | +* Intermediate developers and beginners looking for a way to structure their app in a testable and maintainable way. |
| 53 | +* Advanced developers looking for quick reference. |
| 54 | + |
| 55 | +## Opening a sample in Android Studio |
| 56 | + |
| 57 | +To open one of the samples in Android Studio, begin by checking out one of the sample branches, and then open the root directory in Android Studio. The following series of steps illustrate how to open the [usecases](tree/usecases/) sample. |
| 58 | + |
| 59 | +Clone the repository: |
| 60 | + |
| 61 | +``` |
| 62 | +git clone [email protected]:googlesamples/android-architecture.git |
| 63 | +``` |
| 64 | +This step checks out the master branch. If you want to change to a different sample: |
| 65 | + |
| 66 | +``` |
| 67 | +git checkout usecases |
| 68 | +``` |
| 69 | + |
| 70 | +**Note:** To review a different sample, replace `usecases` with the name of sample you want to check out. |
| 71 | + |
| 72 | +Finally open the `android-architecture/` directory in Android Studio. |
3 | 73 |
|
4 | 74 | ### License
|
5 | 75 |
|
|
0 commit comments