Sérgio Barriviera Miguel

Hands-On Software Architect

Porto Area, Portugal

Android Starter Application

Comprehensive Android Starter Kit Offering Data Synchronization and Pre-Configured Common Features

Summary

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.

Architectural Scope
  • Event-driven architecture and reactive programming
  • Data Synchronization options: Server-First or Local-First

Common Features
  • User Interface: Splash Screen, OnBoarding, Login and Home with Drawer Menu
  • Navigation Handler: Activities and Fragments Manipulation
  • Sample Customer CRUD Operation
Application Overview

Application

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.

Icon and Splash Screen

Application Icon and SplashScreen

OnBoarding

Three steps screen
Application OnBoarding Screen

Login and Home

Application Login, Drawer Menu and Home Screen
Application Login, Menu and Home Screen

Sample CRUD

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.

Add Customer

Application Add Customer Screen

Check Added Customer and Trace Data

Trace Area: Used to show local and remote identifications (LOCAL ID and REMOTE ID) and timestamps.

Application Trace Customer Screen

Customers List and Delete Operation

Delete operation: The user interface feature is available in two flavors: Swipe and Toolbar Icon.

Application Delete Customer Screen

Simulating Device with no Internet Connection

Application Add Offline Customer Screen

Simulating Device Behavior When Internet Connection Restored

Application Add Online Customer Screen

Software Architecture Approach

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

Overview

Application Overview

( * ) Synchronization Job Component will be used when selected data synchronization strategy is "Local-First" model, as mentioned below.

Possible
Strategies

Data Synchronization Strategy

1. "Server-First"

  • Only handle data that exists on server side
  • Call Endpoint 1 and after a successfully response local database will be updated 2
Data Synchronization Strategy - Server First

2. "Local-First"

  • Shows data based on local repository
  • Saves data into local repository 1 and after that performs remote data synchronization 2
Data Synchronization Strategy - Local First

Selected
Strategy

"Local-First" Data Synchronization Strategy

Before starting with code, let's review our component organization and our processing strategy, balancing between foreground and background operations.

Foreground and Background Operations

Using an acceleration framework

Starter Application: Tailoring Architecture

Using Starter Application - Tailoring Architecture

Using an acceleration framework

Starter Application: Software Development

Using Starter Application - Accelerating Application Development

Application

Resources Reference

  • Android Support library
  • Android Architecture Components
  • Butterknife
  • Dagger
  • RxAndroid, RxRelay and RxLint
  • Gson, OkHttp and Retrofit
  • Priority Job Queue
  • GCM Network Manager
  • Timber
  • Chuck and Stetho

Full details and versions available at Github

Looking to turn your ideas into reality?

API, Web and Mobile

Contact me at [email protected], and I'll assist you in bringing them to fruition.

  back to main page