Archive for the ‘Backup / Restore’ Category
In a previous series on Styling Android we looked at persisting data using the Data Backup APIs. However the Google documentation suggests that this technique is unsuitable for persisting app state across multiple devices, but more for persisting app state when a user replaces a device. At Google I/O 2013 a new API was introduced, which is part of Google Play Services, that is specifically designed to persist app state across multiple devices: Cloud Save. In this short series fo articles we’ll look at how to implement this.
In the first article in this series we had a first look at Android Data Backup. We got a simple app working which successfully stored its SharedPreferences in the cloud and restored them we the app was re-installed. Thee was one problem, however: If we manually triggered a restore of the SharedPreferences, we did not receive a callback when the restore occurred despite registering an OnSharedPreferenceChangeListener. Let’s discover why…
Normally on Styling Android I try and stick to UI / UX tips and techniques, but in this series of articles I’m going to cover a topic that is not directly UI / UX specific yet, if implemented, can delight your users: using Android Data Backup to backup and restore app settings / config to the cloud. The technique that we’re going to explore is something that I implemented a while ago in an app that I created just for my own use, but whenever I switch devices, I’m always pleasantly surprised when my config magically reappears on the new device, and I don’t need to configure my app from scratch. Data backup is something that Google Developer Advocate Richard Hyndman has recently blogged about demonstrating how app settings can be manually backed up and restored on ICS. I can only agree with Richard’s sentiment that it is a pity that more games do not implement cloud backup to store your progress. In this series of articles we’ll look at how easy it is to implement cloud backup in your app using the built in Data Backup tools.