Places SDK for Android(新版)可提供更出色的性能和新的定价模式,因此值得更新使用 Places SDK for Android 的应用。如需详细了解如何比较功能,请参阅选择 SDK。
通过本指南,了解 Places SDK for Android(新版)与 Places SDK for Android 之间的主要区别,以及如何处理必要的更改。
迁移的结算最佳实践
warning_amber
如果您的 API 用量足够高,达到了第二层级的价格,则适用此指南。迁移到较新版本的 API 时,您还需要按其他 SKU 付费。为避免在过渡月份增加费用,我们建议您尽可能在月初切换到生产环境中的新 API。这样可以确保您在迁移月份达到最具成本效益的每月价格层级。如需了解价格层级,请参阅价格页面和价格常见问题解答。
启用 Places SDK for Android(新)
Places SDK for Android 依赖于 Places API 服务。如需使用 Android 版 Google 地图 SDK(新版)的功能,您必须先在 Google Cloud 项目中启用 Places API(新版)。如需了解详情,请参阅设置您的 Google Cloud 项目。
然后,您必须确保已将 Places API(新)添加到应用使用的 API 密钥。如需了解详情,请参阅使用 API 密钥。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-01-14。"],[[["The Places SDK for Android (New) offers enhanced performance and a revised pricing structure, encouraging app updates."],["To minimize potential cost increases, it's advisable to transition to the new APIs at the start of a billing cycle."],["Before using the new SDK, enable the \"Places API (New)\" in your Google Cloud project and include it in your API key."],["Places SDK for Android (New) introduces mandatory field masking for Place Details, Nearby Search, and Text Search, defining specific data returned in responses."],["New features like Text Search (New) and Nearby Search (New) are additions to the SDK and do not require migration from existing functionalities."]]],[]]