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

Overview

Now in Android

Now in Android App [Work in progress 🚧 ]

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.

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 early stage development and is not yet available on the Play Store.

Features

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 or follow specific authors.

Screenshots

Screenshot showing For You screen Screenshot showing Interests screen Screenshot showing Topic detail screen

Development Environment

Now in Android uses the Gradle build system and can be imported directly into the latest stable version of Android Studio (available here). The debug build can be built and run using the default configuration.

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.

NOTE: Building the app using an M1 Mac will require the use of Rosetta. See the following bug for more details.

Architecture

The Now in Android app follows the official architecture guidance and is described in detail in the architecture learning journey.

Modularization

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.

Build

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.

Testing

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.

UI

The app was designed using Material 3 guidelines. Learn more about the design process and obtain the design files in the Now in Android Material 3 Case Study (design assets also available as a PDF).

The Screens and UI elements are built entirely using Jetpack Compose.

The app has two themes:

  • Dynamic color - uses colors based on the user's current color theme (if supported)
  • Default theme - uses predefined colors when dynamic color is not supported

Each theme also supports dark mode.

The app uses adaptive layouts to support different screen sizes.

Find out more about the UI architecture here.

Baseline profiles

The baseline profile for this app is located at app/src/main/baseline-prof.txt. It contains rules that enable AOT compilation of the critical user path taken during app launch. For more information on baseline profiles, read this document.

Note: The baseline profile needs to be re-generated for release builds that touch code which changes app startup.

To generate the baseline profile, select the benchmark build variant and run the BaselineProfileGenerator benchmark test on an AOSP Android Emulator. Then copy the resulting baseline profile from the emulator to app/src/main/baseline-prof.txt.

License

Now in Android is distributed under the terms of the Apache License (Version 2.0). See the license for more information.

You might also like...
This is a sample app(For beginners - App #1) built using Jetpack Compose
This is a sample app(For beginners - App #1) built using Jetpack Compose

This is a sample app(For beginners - App #1) built using Jetpack Compose. It is a simple - single screen app to demonstrate use of basic Jetpack Compose UI elements like Text, Image and Button & LazyColumn (Vertical Recyclerview). It also demonstrates how compose manages state with a Boolean State.

From Swedish
From Swedish "Öppettider", an app to quickly access your favorite places' opening times. Built to practice Android development and try out Jetpack Compose.

Appettider From Swedish "Öppettider", an app to quickly access your favorite places' opening times. Built to practice Android development and try out

A Rick and Morty app built with Jetpack Compose.
A Rick and Morty app built with Jetpack Compose.

RickAndMortyCompose A Rick and Morty app built with Jetpack Compose. 📱 Demo ✨ Features Compose UI Kotlin Coroutines Compose Navigation MVVM Architect

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.
Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

JetFlix - A clone of Android NetFlix app in Android built using Jetpack compose.
JetFlix - A clone of Android NetFlix app in Android built using Jetpack compose.

JetFlix A clone of Android NetFlix app in Android built using Jetpack compose. This sample app showcases the following: MVVM Architecture (ViewModel +

An Android / Wear OS app built with Jetpack Compose to search for definitions of English words
An Android / Wear OS app built with Jetpack Compose to search for definitions of English words

EnglishDictionary A simple Android / Wear OS app built with Jetpack Compose to s

An android library to highlight different features of the app built using Jetpack Compose.
An android library to highlight different features of the app built using Jetpack Compose.

An android library to highlight different features of the app built using Jetpack Compose.

Morph is an Android library, written in Kotlin, built to work together with Jetpack Compose.
Morph is an Android library, written in Kotlin, built to work together with Jetpack Compose.

Morph Morph is an Android library, written in Kotlin, built to work together with Jetpack Compose. It allows you to transition any view to another vie

This app can be used to track open slots for vaccination. This is built using Jetpack Compose.
This app can be used to track open slots for vaccination. This is built using Jetpack Compose.

Covid Vaccine This projects used the Cowin APIs provided by the government. Screenshots Tech Stack Used Kotlin Dagger Hilt Clean Architecture with Mod

Comments
  • Typo fix for compact

    Typo fix for compact

    #510 compcatWidth_mediumHeight_showsNavigationBar is misspelled in NavigationUiTest.kt which should actually be compactWidth_mediumHeight_showsNavigationBar.

    opened by anasshamsi97 0
  • Compact is misspelled as compcat in NavigationUiTest.kt

    Compact is misspelled as compcat in NavigationUiTest.kt

    compcatWidth_mediumHeight_showsNavigationBar is misspelled in NavigationUiTest.kt which should actually be compactWidth_mediumHeight_showsNavigationBar.

    opened by anasshamsi97 0
  • Update all dependencies

    Update all dependencies

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---|---|---| | gradle (source) | | minor | 7.5.1 -> 7.6 | age | adoption | passing | confidence | | com.google.devtools.ksp (source) | plugin | patch | 1.7.21-1.0.8 -> 1.7.22-1.0.8 | age | adoption | passing | confidence | | org.jetbrains.kotlin.plugin.serialization (source) | plugin | patch | 1.7.21 -> 1.7.22 | age | adoption | passing | confidence | | org.jetbrains.kotlin.jvm (source) | plugin | patch | 1.7.21 -> 1.7.22 | age | adoption | passing | confidence | | org.jetbrains.kotlin:kotlin-gradle-plugin (source) | dependencies | patch | 1.7.21 -> 1.7.22 | age | adoption | passing | confidence | | org.jetbrains.kotlin:kotlin-stdlib-jdk8 (source) | dependencies | patch | 1.7.21 -> 1.7.22 | age | adoption | passing | confidence | | com.diffplug.spotless:spotless-plugin-gradle | dependencies | minor | 6.11.0 -> 6.12.0 | age | adoption | passing | confidence | | com.android.tools:desugar_jdk_libs | dependencies | major | 1.2.2 -> 2.0.0 | age | adoption | passing | confidence |


    Release Notes

    google/ksp

    v1.7.22-1.0.8

    Compare Source

    KSP 1.0.8 for Kotlin 1.7.22

    JetBrains/kotlin

    v1.7.22: Kotlin 1.7.22

    This is a technical release. It doesn't contain any fixes that aren't included in Kotlin 1.7.21. Version 1.7.22 of the Kotlin plugin will not be available for downloading or installing in any IDEs.

    Checksums

    | File | Sha256 | | --- | --- | | kotlin-compiler-1.7.22.zip | 9db4b467743c1aea8a21c08e1c286bc2aeb93f14c7ba2037dbd8f48adc357d83 | | kotlin-native-linux-x86_64-1.7.22.tar.gz | dd004d520056aba67f2955a3bec5af75f8f2d78b179d4b5f733a77e3eef57aff | | kotlin-native-macos-x86_64-1.7.22.tar.gz | 153fa411fa8c993ce2635e2504e9b102cb05362cc794b66ef9def26a78b427b5 | | kotlin-native-macos-aarch64-1.7.22.tar.gz | 4ffcd76c77cc824eff8addd5e2a73da4f3bbd3584fa9ef282b3f669c45426b1e | | kotlin-native-windows-x86_64-1.7.22.zip | 3bccd23479848ec61c56ed5760010456d17acbe88a00a1f10fb38eae256f2e92 |

    google/desugar_jdk_libs

    v2.0.0

    • Release based on JDK-11. Require AGP version 7.4.0-alpha10 or later (Android Studio 2022.1.1).
    • Supports three different configurations desugar_jdk_libs_minimal, desugar_jdk_libs and desugar_jdk_libs_nio.
      • desugar_jdk_libs_minimal limits desugaring to package java.util.function and class java.util.Optional.
      • desugar_jdk_libs desugars the same APIs as in version 1.1.x and 1.2.x.
      • desugar_jdk_libs_nio includes desugaring of package java.nio.

    Configuration

    📅 Schedule: Branch creation - "before 2am" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • added a string resources class UiText.kt in core:common this function…

    added a string resources class UiText.kt in core:common this function…

    … can be used in the entire project in order to have access to string resources also i have refactored the core:module by adding a manifest and the access to the core:common in core:common in the NewsResourceType.kt i have used the UiText.kt to change the description to stringResources

    opened by ALI-M0vS5a 4
Owner
Android
Android
An Android imageboard client with the focus on maximum performance, fully written with Jetpack Compose

This project is an experimental playground to try implementing an application entirely with Jetpack Compose without using the old Android UI framework.

Dmitry 31 Dec 30, 2022
ComposePrefs3 is a fully featured library of preference composables for Jetpack Compose.

ComposePrefs3 This is the M3 version of ComposePrefs. The M2 version can be found here. ComposePrefs3 is a preferences library for Jetpack Compose whi

Jamal Mulla 21 Dec 2, 2022
This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

JetBMICalculator This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Co

BHAVNA THACKER 3 Dec 31, 2022
Jetpack-compose-uis - A collection of some UIs using Jetpack Compose. built using Katalog

Jetpack Compose UIs This is a collection of some UIs using Jetpack Compose. It i

Mori Atsushi 3 Dec 15, 2022
laboratory is the next generation Minecraft server management tool fully written in Kotlin

laboratory laboratory is the next generation Minecraft server management tool fully written in Kotlin Installation Linux: Clone this repository using

mooz 5 Oct 29, 2022
📱 WhatsApp clone project demonstrates modern Android development built with Jetpack Compose and Stream Chat SDK for Compose.

This is a WhatsApp clone app built with Jetpack Compose and Stream Chat SDK for Compose. The purpose of this repository is to demonstrate below: Imple

Stream 689 Dec 25, 2022
Fully customizable implementation of Snowfall View on Android

Android-Snowfall Fully customizable implementation of "Snowfall View" on Android. That's how we use it in our app Hotellook Compatibility This library

Daniel Jette 0 Dec 4, 2021
ToDo-Task-App - An Android App built to demonstrate the use of Jetpack Compose, Material You, Room Database, and MVVM

ToDo Task App ToDo Task App is a sample Android app built with Jetpack Compose.

null 0 Jan 17, 2022
Formula 1 app to show current Standings from a REST API.Built using jetpack compose and kotlin.

Formula1 Formula 1 app to show Standings fetching data from REST API ?? Screenshots Tech Stack. Kotlin - Kotlin is a programming language that can run

Ezra Kanake 5 Oct 28, 2022
A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose

Authentication A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose Scree

Felix Kariuki 5 Dec 29, 2022