0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Places SDK for Androidのレスポンス

Posted at

まえ書き

自宅で確認した内容を会社PCで確認するため急いでアップしました。
今後ちゃんとした記事に修正していく予定です。

Places SDK for Android(New)のレスポンスを調査

以下の「List places = response.getPlaces();」の
placesで取得できるレスポンスについて記載する。

    private void searchPlace(String query) {
        // 表示項目の指定
        List<Place.Field> placeFields = Arrays.asList(
                Place.Field.ID,
                Place.Field.DISPLAY_NAME,
                Place.Field.LOCATION
        );

        LatLng searchCenter = new LatLng(34.702485, 135.495951);

        // リクエスト作成
        SearchByTextRequest request = SearchByTextRequest.builder(query, placeFields)
                .setLocationBias(CircularBounds.newInstance(searchCenter, 1000.0))
                .setRegionCode("JP")
                .build();

        // 検索実行
        placesClient.searchByText(request)
                .addOnSuccessListener(response -> {
                    List<Place> places = response.getPlaces();

検索文字列について

試験的に「守口」というワードで検索した結果です。

端末の言語がEnglishの場合

SearchByTextResponse{places=[Place{address=null, formattedAddress=null, shortFormattedAddress=null, adrFormatAddress=null, addressComponents=null, attributions=null, businessStatus=null, curbsidePickup=UNKNOWN, currentOpeningHours=null, delivery=UNKNOWN, dineIn=UNKNOWN, editorialSummary=null, editorialSummaryLanguageCode=null, iconBackgroundColor=null, iconUrl=null, iconMaskUrl=null, id=ChIJa26M2r_hAGARz0iIzSKmM-E, latLng=lat/lng: (34.7361019,135.56130389999998), location=lat/lng: (34.7361019,135.56130389999998), name=Moriguchi, displayName=Moriguchi, nameLanguageCode=en, displayNameLanguageCode=en, resourceName=null, openingHours=null, phoneNumber=null, internationalPhoneNumber=null, nationalPhoneNumber=null, photoMetadatas=null, reviews=null, placeTypes=null, plusCode=null, priceLevel=null, priceRange=null, primaryType=null, primaryTypeDisplayName=null, primaryTypeDisplayNameLanguageCode=null, rating=null, reservable=UNKNOWN, secondaryOpeningHours=null, currentSecondaryOpeningHours=null, servesBeer=UNKNOWN, servesBreakfast=UNKNOWN, servesBrunch=UNKNOWN, servesDinner=UNKNOWN, servesLunch=UNKNOWN, servesVegetarianFood=UNKNOWN, servesWine=UNKNOWN, takeout=UNKNOWN, types=null, userRatingsTotal=null, userRatingCount=null, utcOffsetMinutes=null, viewport=null, websiteUri=null, googleMapsUri=null, wheelchairAccessibleEntrance=UNKNOWN, accessibilityOptions=AccessibilityOptions{wheelchairAccessibleParking=UNKNOWN, wheelchairAccessibleEntrance=UNKNOWN, wheelchairAccessibleRestroom=UNKNOWN, wheelchairAccessibleSeating=UNKNOWN}, parkingOptions=ParkingOptions{freeParkingLot=UNKNOWN, paidParkingLot=UNKNOWN, freeStreetParking=UNKNOWN, paidStreetParking=UNKNOWN, valetParking=UNKNOWN, freeGarageParking=UNKNOWN, paidGarageParking=UNKNOWN}, paymentOptions=PaymentOptions{acceptsCreditCards=UNKNOWN, acceptsDebitCards=UNKNOWN, acceptsCashOnly=UNKNOWN, acceptsNfc=UNKNOWN}, evChargeOptions=null, outdoorSeating=UNKNOWN, liveMusic=UNKNOWN, menuForChildren=UNKNOWN, servesCocktails=UNKNOWN, servesDessert=UNKNOWN, servesCoffee=UNKNOWN, goodForChildren=UNKNOWN, allowsDogs=UNKNOWN, restroom=UNKNOWN, goodForGroups=UNKNOWN, goodForWatchingSports=UNKNOWN, subDestinations=null, fuelOptions=null, pureServiceAreaBusiness=UNKNOWN}], routingSummaries=null}

端末の言語が日本語の場合

Place{address=null, formattedAddress=null, shortFormattedAddress=null, adrFormatAddress=null, addressComponents=null, attributions=null, businessStatus=null, curbsidePickup=UNKNOWN, currentOpeningHours=null, delivery=UNKNOWN, dineIn=UNKNOWN, editorialSummary=null, editorialSummaryLanguageCode=null, iconBackgroundColor=null, iconUrl=null, iconMaskUrl=null, id=ChIJa26M2r_hAGARz0iIzSKmM-E, latLng=lat/lng: (34.7361019,135.56130389999998), location=lat/lng: (34.7361019,135.56130389999998), name=守口市, displayName=守口市, nameLanguageCode=ja, displayNameLanguageCode=ja, resourceName=null, openingHours=null, phoneNumber=null, internationalPhoneNumber=null, nationalPhoneNumber=null, photoMetadatas=null, reviews=null, placeTypes=null, plusCode=null, priceLevel=null, priceRange=null, primaryType=null, primaryTypeDisplayName=null, primaryTypeDisplayNameLanguageCode=null, rating=null, reservable=UNKNOWN, secondaryOpeningHours=null, currentSecondaryOpeningHours=null, servesBeer=UNKNOWN, servesBreakfast=UNKNOWN, servesBrunch=UNKNOWN, servesDinner=UNKNOWN, servesLunch=UNKNOWN, servesVegetarianFood=UNKNOWN, servesWine=UNKNOWN, takeout=UNKNOWN, types=null, userRatingsTotal=null, userRatingCount=null, utcOffsetMinutes=null, viewport=null, websiteUri=null, googleMapsUri=null, wheelchairAccessibleEntrance=UNKNOWN, accessibilityOptions=AccessibilityOptions{wheelchairAccessibleParking=UNKNOWN, wheelchairAccessibleEntrance=UNKNOWN, wheelchairAccessibleRestroom=UNKNOWN, wheelchairAccessibleSeating=UNKNOWN}, parkingOptions=ParkingOptions{freeParkingLot=UNKNOWN, paidParkingLot=UNKNOWN, freeStreetParking=UNKNOWN, paidStreetParking=UNKNOWN, valetParking=UNKNOWN, freeGarageParking=UNKNOWN, paidGarageParking=UNKNOWN}, paymentOptions=PaymentOptions{acceptsCreditCards=UNKNOWN, acceptsDebitCards=UNKNOWN, acceptsCashOnly=UNKNOWN, acceptsNfc=UNKNOWN}, evChargeOptions=null, outdoorSeating=UNKNOWN, liveMusic=UNKNOWN, menuForChildren=UNKNOWN, servesCocktails=UNKNOWN, servesDessert=UNKNOWN, servesCoffee=UNKNOWN, goodForChildren=UNKNOWN, allowsDogs=UNKNOWN, restroom=UNKNOWN, goodForGroups=UNKNOWN, goodForWatchingSports=UNKNOWN, subDestinations=null, fuelOptions=null, pureServiceAreaBusiness=UNKNOWN}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?