1page.title=Android Backup Service 2@jd:body 3 4 5<p>Android Backup Service provides a <em>backup transport</em> for Android's <a 6href="{@docRoot}guide/topics/data/backup.html">data backup</a> framework, which allows you 7to copy a user's persistent app data to remote "cloud" storage. Backing up persistent data 8this way provides a restore point for the app on most devices running Android 2.2 or 9higher. The backup service is <em>not</em> designed for synchronizing application data with other 10clients or saving data that you'd like to access at random during the 11application lifecycle.</p> 12 13<p>The Android Backup Service offered by Google provides a backup 14transport on most devices that include Google Play Store and backs up your app data to Google 15servers. The backup transport may differ 16from device to device and which backup transport is available on any device is 17transparent to your application.</p> 18 19<p>In order to use Android Backup Service, you must <a href="{@docRoot}google/backup/signup.html" 20>register your app</a> with the service to receive a key that you must 21include in your Android manifest.</p> 22 23<p class="note"><strong>Note:</strong> Registering your application with Android Backup 24Service does not guarantee that it will always back up data using this service 25from Google. If you support 26data backup in your application, then it will back up using whichever transport is enabled 27on the device. Registering with Android Backup Service allows your application to back up 28when the backup transport on the device is provided by Android Backup Service.</p> 29 30<p>For more information about how data backup works on Android and how to use it in your app, 31read the <a href="{@docRoot}guide/topics/data/backup.html">Data Backup</a> guide.</p> 32 33 34 35<h2>Adding the Backup Service Key to the Manifest</h2> 36 37<p>Once you <a href="{@docRoot}google/backup/signup.html" 38>register your app</a>, you'll receive a Backup Service Key, 39which you must include in your Android manifest file with the following syntax:</p> 40 41<pre class="prettyprint"> 42<application> 43 <meta-data android:name="com.google.android.backup.api_key" 44 android:value="<em>your_backup_service_key</em>" /> 45 ... 46</application> 47</pre> 48 49<p>Insert your Backup Service Key in the <code>android:value</code> attribute and place the 50<code><meta-data></code> element inside your Android manifest's 51<code><application></code> element.</p> 52 53<p>When a device that uses Android Backup Service runs your application, 54the system verifies that your Backup Service Key is valid and Android Backup Service saves the 55user's data to Google servers using the primary Google account on the device.</p> 56 57<p>If your application 58does not provide a valid Backup Service Key, then backup will not occur. If the device does not 59provide backup using Android Backup Service, then the <code><meta-data></code> element and 60Backup Service Key are ignored—your application will work normally, but will either back up 61data using a different backup transport or not perform backup at all. Either 62way, your application is unaware of what transport is used, if at all, and otherwise 63operates normally.</p> 64 65<p>For more information about how to provide data backup in your Android application, see the <a 66href="{@docRoot}guide/topics/data/backup.html">Data Backup</a> guide.</p> 67 68 69<h2>User Privacy</h2> 70 71<p>At Google, we are keenly aware of the trust users place in us and our responsibility to protect 72users' privacy. Google securely transmits backup data to and from Google servers in order to provide 73backup and restore features. Google treats this data as personal information in accordance with 74Google's <a href="http://www.google.com/privacypolicy.html">Privacy Policy</a>.</p> 75 76<p>In addition, users can disable data backup functionality through the Android 77system's privacy settings. When a user disables backup, Android Backup Service deletes all saved 78backup data. A user can re-enable backup on the device, but Android Backup Service will not restore 79any previously deleted data.</p> 80