将 Drive v2 升级到 v3 时对现有 Android 应用程序的影响(使用 Google 登录)
Impact on existing Android application when upgrading Drive v2 to v3 (Using Google Sign-In)
我们最近将 Android 应用程序从 Drive v2 升级为使用 Drive v3 API。我们上次升级是在 Google Drive 拥有自己的个人 Web 控制台时。在升级过程中,我们注意到我们现在必须使用 GoogleSignIn 才能访问云端硬盘。我们不再像 Drive v2 那样需要单独的 API 键。我们需要生成一个 "google-services.json" 文件并将其包含在我们的应用程序中,而不是密钥。在整个升级过程中,我们一直在使用测试帐户,尚未对生产帐户执行这些更改。
当我们生成新的 JSON 文件并通过 GoogleSignIn 开始使用 Drive v3 时,现有生产 Android 应用程序会发生什么变化,v2 是否仍受现有产品支持应用程序的版本?
首先,有些事情需要清理。根据 v3 Migration Guide v3 的显着变化是:
The differences between Drive API v3 and v2 are mainly changes to
field names and removal of duplicate functionality.
Notable changes
- Full resources are no longer returned by default. Use the fields query parameter to request specific fields to be returned. If left
unspecified only a subset of commonly used fields are returned.
- Duplicate and obsolete functionality has been removed. Examples:
- The Children and Parents collections have been removed. Use files.list instead.
- The Realtime.* methods have been removed. See the Realtime API documentation for alternatives.
- A number of field and parameter names have changed and affects accessing fields in resources as well as q and fields expressions.
Examples include:
- The property name is now used in placed of title.
- All date/time fields are now suffixed with Time instead of Date.
- Results from list operations no longer use a generic items field to contain the result set. Results are now included in a field named
for the corresponding resource type (e.g. files, changes, etc.).
- All update operations now use PATCH instead of PUT
- The exportLinks field has been removed from files. To export Google Documents, use the files.export method instead.
- The general approach for changes.list has changed. Opaque page tokens are now used in place of change ids. To poll the change
collection, first call changes.getStartPageToken for the initial
value. For subsequent queries, uses the newStartPageToken value
returned from changes.list.\
请注意,与您所说的相反,未提及 Google Sign。我认为这只是 log-in 的 alternative/easier 方法之一。您仍然可以使用 v2.
如果您想使用 v3,请检查 v3 Android Quickstart 以获取代码参考。
我们最近将 Android 应用程序从 Drive v2 升级为使用 Drive v3 API。我们上次升级是在 Google Drive 拥有自己的个人 Web 控制台时。在升级过程中,我们注意到我们现在必须使用 GoogleSignIn 才能访问云端硬盘。我们不再像 Drive v2 那样需要单独的 API 键。我们需要生成一个 "google-services.json" 文件并将其包含在我们的应用程序中,而不是密钥。在整个升级过程中,我们一直在使用测试帐户,尚未对生产帐户执行这些更改。
当我们生成新的 JSON 文件并通过 GoogleSignIn 开始使用 Drive v3 时,现有生产 Android 应用程序会发生什么变化,v2 是否仍受现有产品支持应用程序的版本?
首先,有些事情需要清理。根据 v3 Migration Guide v3 的显着变化是:
The differences between Drive API v3 and v2 are mainly changes to field names and removal of duplicate functionality.
Notable changes
- Full resources are no longer returned by default. Use the fields query parameter to request specific fields to be returned. If left unspecified only a subset of commonly used fields are returned.
- Duplicate and obsolete functionality has been removed. Examples:
- The Children and Parents collections have been removed. Use files.list instead.
- The Realtime.* methods have been removed. See the Realtime API documentation for alternatives.
- A number of field and parameter names have changed and affects accessing fields in resources as well as q and fields expressions. Examples include:
- The property name is now used in placed of title.
- All date/time fields are now suffixed with Time instead of Date.
- Results from list operations no longer use a generic items field to contain the result set. Results are now included in a field named for the corresponding resource type (e.g. files, changes, etc.).
- All update operations now use PATCH instead of PUT
- The exportLinks field has been removed from files. To export Google Documents, use the files.export method instead.
- The general approach for changes.list has changed. Opaque page tokens are now used in place of change ids. To poll the change collection, first call changes.getStartPageToken for the initial value. For subsequent queries, uses the newStartPageToken value returned from changes.list.\
请注意,与您所说的相反,未提及 Google Sign。我认为这只是 log-in 的 alternative/easier 方法之一。您仍然可以使用 v2.
如果您想使用 v3,请检查 v3 Android Quickstart 以获取代码参考。