O'Reilly logo

Xamarin Mobile Development for Android Cookbook by Matthew Leibowitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Backing up data to the cloud

Often, an app will need to backup it's data, especially if the data took time, effort or money to collect. The Android Backup Service provides a means of preserving data that is more complex than simple shared preferences or files.

Getting ready...

In order to work with the backup API, we have to have registered our app package name with the Android Backup Service.

We do this on http://developer.android.com/google/backup/signup.html.

How to do it...

In this recipe, we will save a value to a file and read from a file. This can be a far more comprehensive set of actions on a larger dataset, but not necessary, for example:

  1. Our app is not going to do much with the data, so we can save our single value to the filesystem as a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required