A multi-module repository which is a successor of RoomDemo. This repository contains three individual modules, developed using latest trends.
To start development from scratch, It is strongly recommended to follow:
Making a Notes App Using Room Database: Pavneet Singh.
The room-demo-kotlin-mvvm-dagger
module is the most updated module and will be updated in near future.
It is written in kotlin and based on the MVVM architecture for clean code architecture with Dagger 2, to implement unit testing.
It simplifies the code using andorid jetpack with ViewModel, Data-Binding, LiveData, Coroutines, Room and Lifecyclee though if you are a fan of RxAdnroid then can follow the room-demo-rxandroid-livedata
module.
Follow room-demo-kotlin-mvvm-dagger for clean architecture implementation, recommended by Google in Guide to app architecture
This repository is divided into three independent modules which can be labeled as per complexity, based on underlying architecture and libs as:
room-demo-kotlin-mvvm-dagger: Advance
- MVVM - Google recommended architecture to achieve smooth UI and background task management.
- Android KTX - Write concise code as kotlin help to reduce code length by 20 - 40%.
- Architecture - MVVM architecture with recommended practices and libs to implement UI, persistence and networking etc.
- Data Binding - To automatically handle UI and data handling(binding, updates etc) in XML via observer pattern.
- Lifecycles - Hassle-free UI updates to avoid memory leaks, crashes and smooth task execution flow.
- LiveData - Observer pattern based object to deliver data on UI(main) thread.
- Room - SQLite database with ORM.
- ViewModel - A logical entity to handle actions and background tasks with data persistence via viewmodelProviders and factory.
- Kotlin Coroutines: For background thread management and execution.
- Dagger 2 For dependency injector.
- UI - Google material design lib with CardView and RecyclerView.
room-demo-rxandroid-livedata: Intermediate
- Java 8 - Write concise code with java-8 lambda and methods reference support.
- RxAndroid - To handle background task management and data transformation.
- Lifecycles - Hassle-free UI updates to avoid memory leaks, crashes and smooth task execution flow.
- LiveData - Observer pattern based object to deliver data on UI(main) thread.
- Room - SQLite database with ORM.
- UI - Google material design lib with CardView and RecyclerView.
room-demo-android-q: Beginner
- Java 8 - Write concise code with Java-8 lambda and methods reference support.
- AsyncTask Deprecated - To handle background task management and data transformation.
- Room - SQLite database with ORM.
- UI - Google material design lib with CardView and RecyclerView.
Note: This uses allowMainThreadQueries()
for demonstration and ease, which either should be replaced with AsyncTask
or by RxJava
or Coroutines
(view other modules).
- Android Studio Stable Release
- Emulator - Android Q, R
- Testing Device - Android Pie
PRs are welcome though for major changes, raise an issue otherwise
- Fork the repo
- Create a new branch e.g. feature/feature-name, issue/issue-name
- Commit your changes
- Raise a PR
View Apache License
Copyright 2020 Pavneet Singh.
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.