The Places SDK for Android (New) provides improved performance and a new pricing model, making it worthwhile to update apps that use the Places SDK for Android (Legacy). For more details on comparing features, see Choose your SDK .
Use this guide to understand key differences in the Places SDK for Android (New) compared to the Places SDK for Android (Legacy), along with how to handle necessary changes.
بهترین شیوههای صدور صورتحساب برای مهاجرت
این راهنمایی در صورتی اعمال میشود که استفاده از API شما به اندازهای بالا باشد که به قیمتگذاری سطح دوم روی بیاورید. هنگام مهاجرت به نسخه جدیدتر API، هزینه SKU متفاوتی نیز برای شما محاسبه میشود. برای جلوگیری از افزایش هزینهها در طول ماه انتقال، توصیه میکنیم تا حد امکان نزدیک به ابتدای ماه به APIهای جدید در حال تولید تغییر دهید. این کار تضمین میکند که در طول ماه مهاجرت به مقرونبهصرفهترین سطوح قیمتگذاری ماهانه دسترسی پیدا کنید. برای کسب اطلاعات در مورد سطوح قیمتگذاری، به صفحه قیمتگذاری و سوالات متداول قیمتگذاری مراجعه کنید.
فعال کردن API مکانها (جدید)
Places SDK for Android (Legacy) relies on the Places API service. To use the features of Places SDK for Android (New), you must first enable Places API (New) in your Google Cloud project. For more information, see Set up your Google Cloud project .
You then must ensure that you have added Places API (New) to the list of authorized APIs on the key used by your app. For more information, see Use API Keys .
Ensure that you have enough quota in Places API (New)
Make sure that there is enough quota in the Places API (New) to cover your current traffic. To review and manage your quotas and usage limits, see Quotas and quota alerts .
Note the difference:
- The quota for Places SDK for Android (Legacy) relies on the quota of the Places API service. It is the sum of all Places API methods.
- The quota for Places SDK for Android (New) relies on the quota of the Places API (New) service. There is a separate quota for each API method.
Check if your negotiated agreement includes Places API (New)
If you have a negotiated agreement, check that it covers the Places API (New), with the expected pricing. If not, contact your Sales contact person at Google or your partner to discuss how you can include this API.
تغییرات کلی
برخی از تغییرات کلی که برای چندین API اعمال میشوند عبارتند از:
از یک مدل قیمتگذاری جدید استفاده میکند. برای اطلاعات قیمتگذاری برای همه APIها، به Places SDK برای اندروید (جدید) مراجعه کنید.
شما باید برنامه خود را با فراخوانی متد
Places.initializeWithNewPlacesApiEnabled()مقداردهی اولیه کنید. برای اطلاعات بیشتر در مورد انتخاب سرویس Places API، به بخش «راهاندازی پروژه Google Cloud» مراجعه کنید.Place Details (New) , Nearby Search (New) , and Text Search (New) require field masks to specify which fields you want returned in the response.
New classes have been added to define the requests or to add new fields to the response.
The response
Placeobject contains the newgetReviews()method that returns a List ofReviewobjects. When your app displays information obtained from thePlaceobject, such as photos and reviews, the app must also display the required attributions.برای اطلاعات بیشتر، به مستندات مربوط به انتسابها مراجعه کنید.
تغییرات خاص API
این بخش شامل راهنماهای مهاجرت زیر برای هر API است:
- Migrate from Place Details (Legacy) to Place Details (New)
- Migrate from Place Photo (Legacy) to Place Photo (New)
- Migrate from Autocomplete (Legacy) to Autocomplete (New)
- Migrate from Current Place (Legacy) to Nearby Search (New)