Places SDK (舊版) 總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
您可以使用 Places SDK,透過文字字串或鄰近程度,搜尋及擷取各種地點類型的資訊。Places SDK 是舊版 Places SDK (新版)。
請參閱本指南,瞭解 Places SDK 版本之間的主要差異,並遷移至 Places SDK (新版)。
各版本提供的 SDK 功能
下表列出各項 SDK 功能所需的 SDK 和 API 版本:
遷移至新版 API
如要遷移至新版 API,請參閱下列遷移指南:
Places SDK for Android (新版) 的強化功能
本節說明 Places SDK for Android (新版) 新增的主要功能。
Places SDK for Android (新版) 是在 Google Cloud 的服務基礎架構上實作,這項實作作業可打造更安全可靠的平台。
這項標準設計可讓各個 SDK 保持一致,進而提升使用 Places SDK for Android (新版) 開發的效率。
Places SDK for Android (新版) 效能更佳,因此值得取代使用現有 SDK 的應用程式。
新功能
Places SDK for Android (新版) 包含所有 SDK 功能的最新版本:
全新 Text Search 服務
Text Search (新版) 可根據字串 (例如「台南魯肉飯」、「西門町附近的鞋店」或「中正路 123 號」),傳回一組地點的相關資訊。這項服務會傳回與文字字串及位置自訂調整設定相符的地點清單。
Place Details (新版) 和 Place Photos (新版) 新增回應資料
Place Photos (New) 新增 URI 回應
您現在可以使用「Place Photo」(新版) 傳回圖片點陣圖的 URI。先前只能傳回圖片點陣圖本身。
簡化計費模式
Places SDK for Android (新版) 簡化了定價方式,您只需為使用的資料付費。簡化計費模式是透過欄位清單 (也稱為欄位遮罩) 實作。
使用 Place Details 和 Text Search 時,您可以透過欄位清單,控管要在回應中傳回的欄位清單。系統只會收取要求資料的費用。使用欄位清單是良好的設計做法,可確保您不會要求不必要的資料,進而避免不必要的處理時間和帳單費用。
如需這兩個 SDK 的詳細定價資訊,請參閱「用量和帳單」一文。
擴展地點類型
新版 SDK 包含新的地點類型,這些類型會以 Place Details 和 Text Search 回應的形式傳回。您也可以在文字搜尋中使用這些新類型和現有類型。新類型已納入表 A。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-30 (世界標準時間)。
[null,null,["上次更新時間:2025-08-30 (世界標準時間)。"],[],[],null,["The Places SDK lets you search for and retrieve information for a variety of\nplace types using a text string or by proximity. Places SDK is the legacy\nversion of Places SDK (New).\n\nUse this guide to understand the key differences between the Places SDK versions\nand migrate to Places SDK (New).\n\nSDK features available in each version\n\nThe following table shows which SDK and API versions are required for each SDK\nfeature:\n\n| Feature | Places API enabled on API key | Initialization method | Minimum SDK version |\n|---------------------------------------------------------------------------------|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|\n| [Autocomplete (New)](/maps/documentation/places/android-sdk/place-autocomplete) | Places API (New) | [`initializeWithNewPlacesApiEnabled()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initializeWithNewPlacesApiEnabled(android.content.Context,%20java.lang.String)) | 3.5.0 |\n| [Place Details (New)](/maps/documentation/places/android-sdk/details-place) | Places API (New) | [`initializeWithNewPlacesApiEnabled()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initializeWithNewPlacesApiEnabled(android.content.Context,%20java.lang.String)) | 3.3.0 |\n| [Nearby Search (New)](/maps/documentation/places/android-sdk/nearby-search) | Places API (New) | [`initializeWithNewPlacesApiEnabled()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initializeWithNewPlacesApiEnabled(android.content.Context,%20java.lang.String)) | 3.5.0 |\n| [Place Photos (New)](/maps/documentation/places/android-sdk/place-photos) | Places API (New) | [`initializeWithNewPlacesApiEnabled()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initializeWithNewPlacesApiEnabled(android.content.Context,%20java.lang.String)) | 3.4.0 |\n| [Text Search (New)](/maps/documentation/places/android-sdk/text-search) | Places API (New) | [`initializeWithNewPlacesApiEnabled()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initializeWithNewPlacesApiEnabled(android.content.Context,%20java.lang.String)) | 3.3.0 |\n| [Place Autocomplete](/maps/documentation/places/android-sdk/autocomplete) | Places API | [`initialize()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initialize(android.content.Context,%20java.lang.String)) | |\n| [Current Place](/maps/documentation/places/android-sdk/current-place) | Places API | [`initialize()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initialize(android.content.Context,%20java.lang.String)) | |\n| [Place Details](/maps/documentation/places/android-sdk/place-details) | Places API | [`initialize()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initialize(android.content.Context,%20java.lang.String)) | |\n| [Place Photos](/maps/documentation/places/android-sdk/photos) | Places API | [`initialize()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initialize(android.content.Context,%20java.lang.String)) | |\n\nMigrate to the new APIs\n\nTo migrate to the new APIs, see the following migration guides:\n\n- [Migrate to Place Details (New)](/maps/documentation/places/android-sdk/migrate-details)\n- [Migrate to Place Photo (New)](/maps/documentation/places/android-sdk/migrate-photo)\n- [Migrate to Autocomplete (New)](/maps/documentation/places/android-sdk/migrate-autocomplete)\n\nEnhancements in Places SDK for Android (New)\n\nThis section covers key features added to Places SDK for Android (New).\n\nImplemented on the Google Cloud standard platform\n\nPlaces SDK for Android (New) is implemented on the [service\ninfrastructure](https://cloud.google.com/service-infrastructure/docs/overview)\non Google Cloud. This implementation brings a more secure and trusted platform.\nThis standard design brings a level of consistency across the SDKs that improve\nthe efficiency of development with Places SDK for Android\n(New).\n\nImproved performance\n\nPlaces SDK for Android (New) provides improved performance, making it\nworthwhile to replace apps that use the existing SDK.\n\nNew features\n\nThe Places SDK for Android (New) includes the latest versions of all of the SDK\nfeatures:\n\n- [Autocomplete (New)](/maps/documentation/places/android-sdk/place-autocomplete)\n- [Place Details (New)](/maps/documentation/places/android-sdk/details-place)\n- [Nearby Search (New)](/maps/documentation/places/android-sdk/nearby-search)\n- [Place Photos (New)](/maps/documentation/places/android-sdk/place-photos)\n- [Text Search (New)](/maps/documentation/places/android-sdk/text-search)\n\nNew Text Search service\n\n[Text Search](/maps/documentation/places/android-sdk/legacy/text-search) (New) returns information\nabout a set of places based on a string --- for example \"pizza in New York\" or\n\"shoe stores near Ottawa\" or \"123 Main Street\". The service responds with a list\nof places matching the text string and any location bias that has been set.\n\nNew response data added to Placed Details (New) and Place Photos (New)\n\n- [Place Details](/maps/documentation/places/android-sdk/details-place)\n (New) now includes the new\n [Review](/maps/documentation/places/android-sdk/legacy/reference/com/google/android/libraries/places/api/model/Review)\n class in the response `Place` object. The\n [Place](/maps/documentation/places/android-sdk/legacy/reference/com/google/android/libraries/places/api/model/Place) class\n contains the new `getReviews()` method to support this field. Call\n `getReviews()` to return up to five reviews for a place.\n\n- [Place Photo](/maps/documentation/places/android-sdk/place-photos)\n (New) adds the\n [`AuthorAttributions`](/maps/documentation/places/android-sdk/legacy/reference/com/google/android/libraries/places/api/model/AuthorAttributions)\n to the `PhotoMetadata` class. `AuthorAttributions` contains a `List` of\n [`AuthorAttribution`](/maps/documentation/places/android-sdk/legacy/reference/com/google/android/libraries/places/api/model/AuthorAttribution)\n objects.\n\nNew URI response added to Place Photos (New)\n\nYou can now use\n[Place Photo](/maps/documentation/places/android-sdk/place-photos)\n(New) to return a URI to an image bitmap. Previously, you could only return the\nimage bitmap itself.\n\nSimplified pricing\n\nPricing is simplified with Places SDK for Android (New) so that you only\npay for the data you use. Simplified pricing is implemented using field lists,\nalso called *field masks*.\n\nWith Place Details and\nText Search you use field lists to control the list of\nfields to return in the response. You are then only billed for the data\nrequested. Using a field list is a good design practice to ensure that you don't\nrequest unnecessary data, which helps to avoid unnecessary processing time and\nbilling charges.\n\nFor detailed pricing information for both SDKs, see [Usage and\nBilling](/maps/documentation/places/android-sdk/usage-and-billing).\n\nExpanded place types\n\nThe new SDK includes new place types, which are returned as part of the\nPlace Details and Text Search\nresponse. You can also use these new types, and the existing types, in a search\nwith Text Search. The new types are included in [Table\nA](/maps/documentation/places/android-sdk/place-types#table-a)."]]