将应用程序数据同步到Google帐户 [英] Syncing app data to Google Account

查看:155
本文介绍了将应用程序数据同步到Google帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个人到底如何使用Android Apps中的Google帐户登录功能?

How exactly does one use the Google account sign in feature in Android Apps?

例如,是否可以将应用程序数据(例如表格,共享首选项等)从Android应用程序存储到google帐户,与应用程序中的常规帐户创建功能相比,这有什么优势?

For example, is it possible to store application data such as tables, shared preferences etc., to a google account from an Android app, and what advantages does this offer over a normal account creation feature inside an app?

我问的原因是,在我打算开发的应用程序中,它将包含一个sqlite数据库,用于将rss url存储到用户,以及共享的首选项和内容提供商.该应用的自定义登录与Google帐户登录过程之间的登录过程有何不同?

The reason I ask is that in the app I plan to develop, it will contain an sqlite database to store rss urls to a user, along with shared preferences and content providers. How would the login process differ between the custom login for the app vs the Google Account login process?

推荐答案

我建议使用 Google云端硬盘Android API ,如果您要将数据存储到云中.

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

要使用这些API,您需要使用本指南.

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

例如,是否可以将应用程序数据(例如表格,共享首选项等)从Android应用程序存储到Google帐户中

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

通过Drive API,您可以将任何类型的文件保存到用户Google Drive帐户的隐藏文件夹中.您可以保存数据库,JSON文件或其他任何想要的内容.

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?

以下是允许您的用户使用Google帐户登录您的应用的一些优点:

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

  1. 安全性-Google花费大量时间和精力来确保Google帐户的安全.如果您在应用中使用Google帐户,则无需花费时间和精力来确保自定义解决方案的安全性.

  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.

便利性-假设您的用户运行的是标准Android,则可以确保他们已经拥有Google帐户.他们不需要创建新帐户,也不需要记住其他密码.

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.

访问Google API-如果您尝试同步到云,则可以使用Google现有的API来同步数据.您不需要自己使用自己的服务器来实现.

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.

如果您只进行本地存储(不需要保存到云中或在设备之间同步),则不需要Drive API,但是您仍然可以获得使用Google帐户的其他好处.

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.

这篇关于将应用程序数据同步到Google帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆