Skip to content

A simple notes app to demo Room, Flow, Compose + MVI architecture in Android

License

Notifications You must be signed in to change notification settings

anitaa1990/NotesApp

Repository files navigation

NotesApp

This is a demo android app on how to implement Room persistance library, making use of Kotlin Flows and Jetpack Compose.



App features

  • Users can add a new note to the local db.
  • Users can view their list of notes from the local db.
  • Users can update a note to the local db.
  • Users can delete a note from the local db.
  • Users can lock a note so that it requires a password to view.
  • Dynamic theme included.
  • Rich text editor is added – so users can style their note (basic styles includes: Bold, Italics, Underline, Strikethrough, Highlight, Heading, Subheading).

App Architecture

Based on MVI (model-view-intent) architecture.

The app includes the following main components:

  • A local database that servers as a single source of truth for data presented to the user.
  • A repository that works with the database, providing a unified data interface.
  • An intent class that handles incoming user actions/interactions with the app.
  • A ViewModel that provides data specific for the UI.
  • The UI, using Jetpack Compose, which shows a visual representation of the data in the ViewModel.
  • Unit Test cases for API service, Database, Repository and ViewModel.

App Packages

  • model
    • di - contains dependency injection classes, using Hilt.
    • db - contains the db classes to cache network data.
    • repository - contains the repository classes, which acts as a bridge between the data and other classes.
  • view
    • ui - contains compose components and classes needed to display note list and note detail screen.
  • intent - contains classes that handles incoming user actions/interactions with the app.
  • composetexteditor - contains classes required for a text editor to style note description.
  • util - contains extension classes needed for date/time conversions.

App Specs

  • Minimum SDK 26
  • Written in Kotlin
  • MVI Architecture
  • Android Architecture Components (ViewModel, Room Persistence Library, Navigation Component for Compose)
  • Kotlin Coroutines and Kotlin Flows.
  • Hilt for dependency injection.
  • Gson for serialisation.
  • Mockito for implementing unit test cases