Throughout this chapter, we have looked at how we can build an offline capability into your app to provide resilience for the inevitable event of a connection loss. We looked at how to detect whether the connection is available or not by using the Connection.Connected function to return a Boolean result based on the connection status.
Once we looked at how to detect the offline state, we then looked at how we could save our data locally to the device to ensure that our users could continue working without a live connection to the data source. To do that, we need to ensure that our data is replicated into a collection, a data source held within the memory of the app, and then replicated to the local device. The local data is encrypted and stored in a private area which is only accessible by the user and the app that created the file.
While we have a connection, it is extremely important to ensure that any changes to the data source are replicated down through the collection to...