Before you begin

This class uses a Xamarin.Forms application to demonstrate caching and synchronization. It supports iOS, Android and UWP. Please select the environment that is easiest for you to work on. To complete the coding exercises, you will need a Xamarin development environment with either a simulator/emulator that supports disabling the network, or a physical device to run the exercise on. Ideally you will be using the emulators to perform the work. Please read the setup requirements if you need help installing the Xamarin development environment.

ASP.NET Development environment
This class also includes a server-side component written in ASP.NET MVC using WebApi. You will not be editing this project during the exercises, but you may want to refer to it later. In order to run or modify the ASP.NET project you will need a Windows machine running Visual Studio 2017 or greater with a connected Microsoft SQL Server. We have uploaded an instance of the ASP.NET MVC site to Azure and the location is already configured within the lab exercise.

Overview

This class shows how to implement data centric mobile applications that will still work even when the application is offline. You will learn to cache data online for later online viewing and also how to implement apps that can create and edit data while offline and then synchronise the data so the view of the remote and local data are consistent.

Objectives

  1. Determining your connectivity strategy
  2. Caching results from a server
  3. Synchronizing to a remote server
  4. Evaluating data sync tools

Lecture

ENT410 - Data Caching and Synchronization.

Exercises

Exercise materials are available from GitHub. The code can be cloned through a desktop Git client or downloaded directly as a ZIP file.

  1. Caching Data from a remote service
    Exercise
    In this exercise, we will connect to a remote service, cache its data locally and use that cached data to display the information when your application is offline.
  2. A coded offline synchronization mechanism
    Demonstration
    The demo code used by the instructor is available in the Demos folder of your copy of the cloned or downloaded course materials.

Additional resources

In this class we will be creating mobile apps that take advantage of offline capabilities, here are some additional tips on working with the technology pieces you may need if you are not already familiar with them.

ASP.NET
Programming the WebApi

Mobile Plug-ins
Mobile Connectivity Plugin. Covered in depth in XAM150 - Consuming REST-based Web Services.

Blog Posts
Resilient network services with mobile Xamarin apps

Oracle MCS
Hand-on with Oracle's Mobile Technology
Oracle Mobile Cloud Service SDK

IBM MobileFirst
IBM MobileFirst SDK
Xamarin and IBM bring cross-platform native apps to enterprise developers