Skip to content

OzolsUgis/SQLDelightCachingMech

Repository files navigation

SQL Delight caching mechanism

Contains
  1. About Project
  2. Usage
  3. Contacts

About Project

This SQLDelight caching mechanism project is simple application which interacts with simple database. Application displays list of persons fetched from remote and local database. Application allows you to add/delete Persons in online & offline mode. When added/deleted while offline values gets cached into local database and after application restart if device is online values are added/ deleted in server.

Built With

This application is built in Android Studio version 2020.3.1 (Artic Fox) using :

Usage

How caching mechanism works

Here you can see empty PersonsDatabase in App Inspection provided by Android Studio and empty PersonsDatabase server in MongoDB Compass

product-screenshot product-screenshot

Application where 2 persons are added in online mode where "done" icon is in green and one person is added in offline mode where icon is red. In App Inspection you can see database with 3 Persons and for the last person Synced atrribute is false ("0"), that means that current person is not synced to remote database

product-screenshot product-screenshot

For this case MongoDB Compass shows that there are only 2 persons, that is because person is stored in local database and waits until it gets synced

product-screenshot

After internet is connected and application restarted then person gets Synced to server and isSynced atribute is true ("1").

product-screenshot product-screenshot product-screenshot

For delete functionality there is seperate table, when person is deleted offline persons id gets stored in this table, and after internet connection is restored this Id gets deleted from remote database.

product-screenshot

Contacts

Ugis Ozols - [email protected]

LinkedIn - www.linkedin.com/in/ozols-ugis

Project Link - https://github.com/OzolsUgis/SQLDelightCachingMech

About

Simple data storing application which uses caching mechanism. Used to learn SQLDelight basics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages