Sync app data with your Google account

How exactly do you use the Google Account Login feature in Android apps?

For example, is it possible to store application data, such as tables, general settings, etc., in a google account from an Android application, and what advantages does this give an advantage over the usual function of creating an account inside the application?

The reason I ask is because in the application that I plan to develop, it will contain a sqlite database for storing rss addresses for the user, as well as general preferences and content providers. How will the registration process be different between the user login for the application and the login process for the Google account?

+11
source share
2 answers

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

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

For example, is it possible to store application data, such as tables, general settings, etc., in a google account from an Android application.

Drive API allows you to save any type of file in a hidden folder on your Google Drive user account. You can save the database, the JSON file, or whatever you want.

What advantages does this offer give over the usual function of creating an account inside the application?

Here are a few benefits that allow your user to use a Google account to log into your application:

  • Security. Google spends a lot of time and effort guaranteeing the security of Google accounts. If you use Google accounts in your application, you do not need to spend time and effort to make your secure solution safe.

  • Convenience. Assuming your users are running standard Android, they already have a Google Account. They do not need to create a new account, and they do not need to remember another password.

  • Access to the Google API. If you are trying to sync with the cloud, you can use existing Google APIs to sync data. You do not need to implement this yourself using your own servers.

If you use only local storage (you don’t need to store in the cloud or synchronize between devices), you do not need Drive APIs, but you still get other benefits of using a Google account.

+27
source

Unfortunately, application data storage is out of date. Here is a discussion of how to replace it. In general, Google recommends using solutions such as Cloud Firestore :

Access to application data
Support for storage and synchronization in the application data folder will most likely be removed from disk in the future. Customers who need to store application data are strongly encouraged to upgrade to a non-drive solution, such as Cloud Firestore.

0
source

Source: https://habr.com/ru/post/975433/


All Articles