Syncing app data to Google Account

I recommend using the Google Drive Android API if you want to store data to the cloud.

To use those APIs, you will need to authenticate your users using this guide.

For example, is it possible to store application data such as tables, shared preferences etc., to a google account from an Android app

The Drive API lets you save any type of file to a hidden folder on the user's Google Drive account. You could save a database, a JSON file, or whatever else you want.

what advantages does this offer over a normal account creation feature inside an app?

Here are a few advantages to allowing your user to use a Google account to sign in to your app:

  1. Security- Google spends a lot of time and energy ensuring that Google accounts are secure. If you use Google accounts in your app, you don't need to spend time and energy making sure your custom solution is secure.

  2. Convenience- Assuming your users are running standard Android, they are guaranteed to have a Google account already. They don't need to create a new account and they don't need to remember another password.

  3. Access to Google APIs- If you are trying to sync to the cloud, you can use existing APIs from Google to sync data. You don't need to implement this yourself using your own servers.

If you are only doing local storage (you don't need to save to the cloud or sync between devices), then you don't need the Drive APIs, but you still get the other benefits of using a Google account.


Unfortunately Storing app data is deprecated now. Here is a discussion about a way to replace it. In general Google recommends to use slutions like Cloud Firestore:

Accessing App Data
Support for storing and syncing in the app data folder will likely be removed from Drive in the future. Clients requiring app data storage are strongly encouraged to migrate to a non-Drive solution such as Cloud Firestore.