A fully functional Android app built entirely with Kotlin and Jetpack Compose

Learn how this app was designed and built in the design case study, architecture learning journey and modularization learning journey.
This is the repository for the Now in Android app. It is a work in progress 🚧.
Now in Android is a fully functional Android app built entirely with Kotlin and Jetpack Compose. It follows Android design and development best practices and is intended to be a useful reference for developers. As a running app, it's intended to help developers keep up-to-date with the world of Android development by providing regular news updates.
The app is currently in development. The prodRelease variant is available on the Play Store.
Now in Android displays content from the Now in Android series. Users can browse for links to recent videos, articles and other content. Users can also follow topics they are interested in, and be notified when new content is published which matches interests they are following.

Now in Android uses the Gradle build system and can be imported directly into Android Studio (make sure you are using the latest stable version available here).
Change the run configuration to app.

The demoDebug and demoRelease build variants can be built and run (the prod variants use a backend server which is not currently publicly available).

Once you're up and running, you can refer to the learning journeys below to get a better understanding of which libraries and tools are being used, the reasoning behind the approaches to UI, testing, architecture and more, and how all of these different pieces of the project fit together to create a complete app.
The Now in Android app follows the official architecture guidance and is described in detail in the architecture learning journey.
The Now in Android app has been fully modularized and you can find the detailed guidance and description of the modularization strategy used in modularization learning journey.
The app contains the usual debug and release build variants.
In addition, the benchmark variant of app is used to test startup performance and generate a
baseline profile (see below for more information).
app-nia-catalog is a standalone app that displays the list of components that are stylized for
Now in Android.
The app also uses product flavors to control where content for the app should be loaded from.
The demo flavor uses static local data to allow immediate building and exploring of the UI.
The prod flavor makes real network calls to a backend server, providing up-to-date content. At
this time, there is not a public backend available.
For normal development use the demoDebug variant. For UI performance testing use the
demoRelease variant.
To facilitate testing of components, Now in Android uses dependency injection with Hilt.
Most data layer components are defined as interfaces.
Then, concrete implementations (with various dependencies) are bound to provide those interfaces to
other components in the app.
In tests, Now in Android notably does not use any mocking libraries.
Instead, the production implementations can be replaced with test doubles using Hilt's testing APIs
(or via manual constructor injection for ViewModel tests).
These test doubles implement the same interface as the production implementations and generally provide a simplified (but still realistic) implementation with additional testing hooks. This results in less brittle tests that may exercise more production code, instead of just verifying specific calls against mocks.
Examples:
In instrumentation tests, a temporary folder is used to store the user's preferences, which is
wiped after each test.
This allows using the real DataStore and exercising all related code, instead of mocking the
flow of data updates.
There are Test implementations of each repository, which implement the normal, full repository
interface and also provide test-only hooks.
ViewModel tests use these Test repositories, and thus can use the test-only hooks to
manipulate the state of the Test repository and verify the resulting behavior, instead of
checking that specific repository methods were called.
To run the tests execute the following gradle tasks:
testDemoDebug run all local tests against the demoDebug variant. Screenshot tests will fail
(see below for explanation). To avoid this, run recordRoborazziDemoDebug prior to running unit tests.connectedDemoDebugAndroidTest run all instrumented testsFLAG_SECURE not working on Google Pixel devices
https://github.com/android/nowinandroid/issues/2132
Labels: bug
[Bug]: Search empty-state copy reads "explorer" instead of "explore"
https://github.com/android/nowinandroid/issues/2127
Labels: bug
[Documentation]: Grammar error in SyncInitializer comment
https://github.com/android/nowinandroid/issues/2121
Labels: documentation
We'd love to accept your sample apps and patches! Before we can take them, we have to jump a couple of legal hurdles.
Please fill out either the individual or corporate Contributor License Agreement (CLA).
Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.