This article will showcase a simple Android project that encompasses common features, including visual elements and a complete CRUD (Create, Read, Update, Delete) operation for a hypothetical customer database. It will also delve into the possible data synchronization strategies.
First, the basic application screens will be presented, followed by a demonstration of a complete CRUD operation. This approach aims to provide better contextualization and showcase the final result.
This article will showcase a complete CRUD operation, accompanied by an in-depth exploration of a data synchronization strategy. The subsequent sections of the article will delve into the specifics of this feature.
Trace Area: Used to show local and remote identifications (LOCAL ID and REMOTE ID) and timestamps.
Delete operation: The user interface feature is available in two flavors: Swipe and Toolbar Icon.
This section will present all the details related to the proposed architecture, including its components, connectors, and their organization. Additionally, the selection of frameworks and the data synchronization strategy will be discussed.
Reference: Google App Architecture
( * ) Synchronization Job Component will be used when selected data synchronization strategy is "Local-First" model, as mentioned below.
Regardless which data synchronization strategy you choose, it is important to guarantee that Repository is always the sole point to keep this rule. Therefore, if you want to change the strategy in the future, it will be simple to do that.
Cache and Data Expiration PolicyAlong this article will be presented an Customer Entity and their attributes. As you will see, there will be timestamps for local and remote operations and these could be used to apply you cache policy.
Before starting with code, let's review our component organization and our processing strategy, balancing between foreground and background operations.
Full details and versions available at Github