חובה לבצע אנונימיזציה של השדה. חובה לציין אילו שדות רוצים להחזיר בתגובה. אין רשימת ברירת מחדל של שדות שמוחזרים. אם לא מציינים את הרשימה הזו, השיטות מחזירות שגיאה.
בקטעים הבאים מתוארים שינויים נוספים.
גישה לסוגים חדשים של מקומות
לכל מקום יכול להיות ערך type אחד או יותר שמשויך אליו. בגרסה 3.3.0 ואילך של Places SDK for Android נוספו הרבה ערכי סוג חדשים. הרשימה המלאה מופיעה במאמר בנושא סוגי מקומות מורחבים.
ה-method Place.getPlaceTypes() מחזיר את ערכי הסוג כרשימה של ערכי מחרוזת. הערכים שמוחזרים תלויים בגרסה של Places SDK ל-Android:
Places SDK ל-Android (חדש): מחזיר את המחרוזות שמוגדרות בטבלה א' ובטבלה ב' שמוצגות בסוגי מקומות (חדש), כולל כל סוגי המקומות שנוספו בגרסה 3.3.0.
Places SDK ל-Android: מחזיר את סוגי ה-enum שמוגדרים על ידי Place.Types, שלא כולל את הסוגים החדשים שנוספו בגרסה 3.3.0 ואילך.
גישה לביקורות על מקומות
Places SDK ל-Android (חדש) מוסיף את המחלקה Review, שמכילה ביקורת על מקום. אובייקט Place יכול להכיל עד חמש ביקורות.
המחלקות Review יכולות להכיל גם שיוך ושיוך מחבר. אם אתם מציגים את הביקורת באפליקציה, אתם צריכים להציג גם את הקרדיט או את הקרדיט למחבר. מידע נוסף זמין במאמר בנושא הצגת ביקורת.
ב-Places SDK ל-Android (גרסה קודמת), השיטה Place.getName() מחזירה מחרוזת טקסט שמכילה את שם המקום. כדי לאכלס את האובייקט Place בשם המקום, צריך לכלול את Place.Field.DISPLAY_NAME ברשימת השדות של בקשת פרטי המקום.
האובייקט Place מכיל עכשיו את קוד השפה של מחרוזת השם. כדי לאכלס את האובייקט Place עם קוד שפה, צריך:
כוללים את Place.Field.DISPLAY_NAME ברשימת השדות של הבקשה.
הערך הזה מגדיר את התשובה כך שתכלול גם את שם המקום וגם את קוד השפה באובייקט Place.
ב-Places SDK ל-Android (חדש) נוסף פרמטר הבקשה region_code לפרטי המקום. קוד האזור משמש לעיצוב התשובה, והוא מוגדר כערך של קוד CLDR בן שני תווים. הפרמטר הזה יכול גם להטות את תוצאות החיפוש. אין ערך ברירת מחדל. כדי להגדיר את קוד האזור, צריך להפעיל את ה-SDK החדש.
אם שם המדינה בשדה הכתובת בתגובה תואם לקוד האזור, קוד המדינה מושמט מהכתובת.
רוב הקודים של CLDR זהים לקודי ISO 3166-1, עם כמה יוצאים מן הכלל.
לדוגמה, ה-ccTLD של בריטניה הוא uk (.co.uk), אבל קוד ISO 3166-1 שלה הוא gb (טכנית, עבור הישות 'ממלכת בריטניה הגדולה וצפון אירלנד'). הפרמטר יכול להשפיע על התוצאות בהתאם לחוק הרלוונטי.
[[["התוכן קל להבנה","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"]],["עדכון אחרון: 2025-09-04 (שעון UTC)."],[],[],null,["# Migrate to Place Details (New)\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\n\u003cbr /\u003e\n\n| This feature requires that you enable Places API (New), the next generation of the Places API. For more information, see [Enable APIs](/maps/documentation/places/android-sdk/legacy/cloud-setup#enabling-apis).\n\n\u003cbr /\u003e\n\nPlaces SDK for Android supports [Place Details (Legacy)](/maps/documentation/places/android-sdk/details-places).\nIf you are familiar with the Places SDK for Android (Legacy), [Place Details (New)](/maps/documentation/places/android-sdk/details-places)\nmakes the following changes:\n\n- Uses a new pricing model. For pricing information for all APIs, see [Places SDK for Android\n (New)](/maps/documentation/places/android-sdk/usage-and-billing#pricing-new).\n\n- You must initialize your app by calling the\n [`Places.initializeWithNewPlacesApiEnabled()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/Places#initializeWithNewPlacesApiEnabled(android.content.Context,%20java.lang.String))\n method. For more information on selecting the Places API service, see\n [Set up your Google Cloud project](/maps/documentation/places/android-sdk/legacy/cloud-setup).\n\n- Field masking is required. You must specify which fields you want returned\n in the response. There is no default list of returned fields. If you omit\n this list, the methods return an error.\n\nThe following sections describe additional changes.\n\nAccess new place types\n----------------------\n\nEach place can have one or more *type* values associated with it. The\nPlaces SDK for Android version 3.3.0 and later adds many new type\nvalues. For the complete list, see [Expanded place\ntypes](/maps/documentation/places/android-sdk/legacy/choose-sdk#expanded_place_types).\n\nThe\n[`Place.getPlaceTypes()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/Place#getPlaceTypes())\nmethod returns the type values as a list of string values. The values returned\ndepend on your version of the Places SDK for Android:\n\n- **Places SDK for Android (New)** : Returns the strings defined by\n Table A and Table B shown on [Place Types (New)](/maps/documentation/places/android-sdk/legacy/place-types), including all\n the added place types added in version 3.3.0.\n\n- **Places SDK for Android** : Returns the enums defined by\n `Place.Types`, which does not include the new types added in version 3.3.0\n and later.\n\nAccess place reviews\n--------------------\n\nThe Places SDK for Android (New) adds the\n[`Review`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/Review)\nclass, which contains a review of a place. The `Place` object can contain up to\nfive reviews.\n\nThe `Review` class can also contain an attribution and an author attribution. If\nyou display the review in your app, then you must also display any attribution\nor author attribution. For more information, see [Display a\nreview](/maps/documentation/places/android-sdk/legacy/policies#reviews).\n\nFor more information, see the documentation on\n[attributions](/maps/documentation/places/ios-sdk/policies#other_attribution_requirements).\n\nAccess place name language code\n-------------------------------\n\nIn the Places SDK for Android (Legacy),\n[`Place.getName()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/Place#public-abstract-string-getname)\nmethod returns a text string containing the name of a place. To populate the\n`Place` object with the place name, you must include the\n`Place.Field.DISPLAY_NAME` in the field list of the place details request.\n\nThe `Place` object now contains the language code for the name string. To\npopulate the `Place` object with language code, you must:\n\n1. Include the `Place.Field.DISPLAY_NAME` in the field list of the request.\n This value configures response to include both the place name and language\n code in the `Place` object.\n\n2. Call\n [`PlacesClient.fetchPlace()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesClient#fetchPlace(com.google.android.libraries.places.api.net.FetchPlaceRequest)).\n `PlacesClient.findCurrentPlace()` does not support the language code field.\n\n3. Use the [`Place.getNameLanguageCode()`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/api/model/Place#public-abstract-string-getnamelanguagecode)\n method to access the language code field in the `Place` object.\n\nSet region code\n---------------\n\nPlaces SDK for Android (New) adds the region code request parameter to\nPlace Details. The region code is used to format the response, specified as a\n[two-character CLDR code](https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html)\nvalue. This parameter can also have a bias effect on the search results. There\nis no default value. You must enable the new SDK to set the region code.\n\nIf the country name of the address field in the response matches the region\ncode, the country code is omitted from address.\n\nMost CLDR codes are identical to ISO 3166-1 codes, with some notable exceptions.\nFor example, the United Kingdom's ccTLD is \"uk\" (.co.uk) while its ISO 3166-1\ncode is \"gb\" (technically for the entity of \"The United Kingdom of Great Britain\nand Northern Ireland\"). The parameter can affect results based on applicable\nlaw.\n\nExample request\n---------------\n\nFor a complete example, see [Place Details\n(New)](/maps/documentation/places/android-sdk/details-place)."]]