当查询谷歌放置web api时,我收到回复。使用Gson在Android中解析响应(是的,我知道我应该使用Android API,但请耐心等待我!)。
所以,问题是......如何找出响应数组中的元素数量?它没有提供给我,我无法在GSON中看到一个功能来支持这个...
Google API查询响应
{
"results": [{
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/101455539104038308910/photos\">The Slug And Lettuce</a>"],
"photo_reference": "CmRdAAAA9pEIMxjlrC48C_BoH2YNjfehfRJ2GE6u-v92-PElO2S7T2xcaQaJYcisL-nlM8lN2rH2ypqsyfSgXF5ccuYVBI01qmfGeHtdLSGk4MbRJKaNOvf9u-1Fyo9GUWuWXJPZEhAUqDsHW42XDGZdzanlYEFPGhTdkxoJ_zucRDC-twU1Rv2f8-Z49g",
"width": 867,
"height": 460
}],
"id": "785a7705f3632e7afd0a21440eb495b5d5fa75d7",
"place_id": "ChIJkUOjQCpxdkgRLt0hNKPFyOI",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/bar-71.png",
"vicinity": "4-5, Thames Edge, 15-18 Clarence Street, Staines",
"scope": "GOOGLE",
"name": "The Slug And Lettuce",
"rating": 3.2,
"types": ["restaurant", "food", "bar", "point_of_interest", "establishment"],
"reference": "CnRoAAAAmLtoaZC2vMxWjt9PNLB_tbw_6QYYKyiDRCDspX4VHJymW7rsv3Z58L1YOlHDoqaRQ4v02UhoS_gu1G05K5pg0xjvIfV3X_ogSMuUzVGUc4Kh-dMVQoY9d5Xp2bdEkVWVsEV6N_vYd_SYt4GE32e8VhIQFqp-odbvEcymu6u2L7HBPxoUu3r3K1qA5Pqx0TkI6dtgSwmUxb4",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5155219999999999,
"lat": 51.433375
}
}
}, {
"price_level": 2,
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/100284282001442253067/photos\">Pizza Express</a>"],
"photo_reference": "CmRdAAAAYu_Ndzcj-ettmAh78Tpq3SqpfJzAOREe1y1XkprAIkmS2O7oTq7i6VKaoSU1q9sQO5CLWfbJw2s9T9K62xqiclTtNRr-73eTnswGF-drlMwx6XunkLPWm-OnHhKWFEz3EhC1d21QN_4xHwgPNZCzh7LQGhRt4FDAXATtzk47X1fRB4mRu5jcxg",
"width": 360,
"height": 270
}],
"id": "30a1d96d781703617bdfc3c34f4ce17b22854323",
"place_id": "ChIJccy0TipxdkgRsP1njQRIIUI",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "12 Clarence Street, Staines Upon Thames, Staines",
"scope": "GOOGLE",
"name": "Pizza Express",
"rating": 3.8,
"types": ["meal_takeaway", "restaurant", "food", "point_of_interest", "establishment"],
"reference": "CmRgAAAAVXaABHgJZkene9JWRCl6gsw6xgyhk_0zLhmUc7CpWMf-pMKnKKfCJ8IyRfB1HDOgZZslUwYmIMZibVdrYvb1eFXX_z3BO0xzD6ZLyw4ket4SCHgn_xRt0gXxHVaCkLr9EhDyNeSTxxldbrfaa68AAIv4GhR_YQNQv9y3qQOU-vUPqsMC5rgY3Q",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.51466,
"lat": 51.43349000000001
}
}
}, {
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/100847769412088525722/photos\">Sam Saltwell</a>"],
"photo_reference": "CmRdAAAAz5mMdAI3PB53AvGEay0IGe-9SMZfrnNKD_Wt-zuknePCZJ6m0Qr0QIpaG4g7G2tjPic_2G9vbtlvvBzFCkP-odp86SXfCFTaZDwLA5UUqVCO3f3pKkYvaX8ZLMOkGdWpEhA-C89FOI2KnswOfLzqw7KzGhThoi5Z8DyU1fYNubewLqiLRTgBIQ",
"width": 1096,
"height": 1096
}],
"id": "f9ee0025174b10972701148a3a5a06ac3981b1e3",
"place_id": "ChIJL3N13y1xdkgRWvY_7sOuf6Q",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "141 - 147 High Street, Staines",
"scope": "GOOGLE",
"name": "Shanghai Restaurant",
"rating": 3.1,
"types": ["restaurant", "food", "point_of_interest", "establishment"],
"reference": "CnRnAAAAFqyw3lIflFys0v8t5b7cFUJgQ3iptREOM2zWk53S9USBw2wFkv58m1KQG39hpXZQo4g4fL7Yr8G-060VKeZy5BYYxfmQHszMqf25gIQeag6x6IFbWMKVPcrBcQS7n5hkk8exJi0V6cH01mc0wRfV_RIQ9hBrwGKyUmXgOzvxNkRBSRoUEFqbbIJN9d2UL2d66eesunOdTuw",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5072403999999999,
"lat": 51.43489289999999
}
}
}, {
"price_level": 2,
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/110129740732143491703/photos\">Andre Catao</a>"],
"photo_reference": "CmRdAAAAH5aCiQdMpemlvMeFzBZEijsr2bJBTtacOsg74UjVVTe0PNl4Kj4l_m41lObjFh7Zl5kqOTuMKwgKpeHko5a0Z1KTBJsJmnzhglaoNT35WFE0zBJiHn0idrQ2rAauvgfbEhBWvL0ed7xtnA35VJyH7UTLGhThBenb0GiDkVlgAnX99xWzYhqgHg",
"width": 3264,
"height": 2448
}],
"id": "51675e6a179d760e5530af75f9aa39441fbdcd3e",
"place_id": "ChIJ4TL-SilxdkgR4gQXXZqYD4w",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "Two Rivers, Campus One, Two Rivers Retail Park, Mustard Mill Road, Staines",
"scope": "GOOGLE",
"name": "Nando's",
"rating": 4.2,
"types": ["restaurant", "meal_takeaway", "food", "point_of_interest", "establishment"],
"reference": "CmRbAAAAR1dml1uQuUnKTCcUxOB4acw7ERSQ7zfh3lKkfPlI0z_8E5ilAm5Hg6PO6hQIcu8258hmOeP386fdA4VYcdrqPgckrbw0V5OXmmIM4F7qMLjqcdmTFUwCFEfVEudz6JKSEhDvYru2jPPKOCe2VrZuB_CDGhTRhhf2aqOi4TMOLegfpIiCs4UgPg",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.512775,
"lat": 51.434392
}
}
}, {
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/103779297855922314604/photos\">Jimmy's Restaurants</a>"],
"photo_reference": "CmRdAAAAjNWp1wyvLW85X3BVw-_IvqKgXsgSEC2Bgg1gN4NEak6UmqabM6brHdLfyqFOcOdJTt-0Nj7RfTyJtF77U88ksMc4PtoILbPhd1e7mymnggQ-aV-WzsW_VUSKVWo9D08eEhDIG-0ISrzmnaFTDRfzQqRaGhRYcS_ajrmtaLU4VX_4J19U8-zaNg",
"width": 2048,
"height": 1363
}],
"id": "d61b5c84ee2c10abf957a8c6b6040c9213faa1eb",
"place_id": "ChIJkUOjQCpxdkgRPq5PDD6D7kA",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "Thames Edge, 15-18 Clarence Street, Staines",
"scope": "GOOGLE",
"name": "Jimmy's Restaurants",
"rating": 2.9,
"types": ["restaurant", "food", "point_of_interest", "establishment"],
"reference": "CnRmAAAA7yQhxVpkyQ6SzpzFqkwzzVHZ8XkTPE4MYcu_BrvvUEURlBUfrtglKOZOFcU1sE8lftVUv-5DoiI0me3FqJQj9C1tHN73h5YAEn7lj6ndFbrp0kIQQX5P94nXeky-h7vPsSjWMwzgarkdAp7HWbP4FRIQC8uzPY5wwd79m7ElLDPRORoUMiZ1Sd-CJ_JhaUGYoMhHiXFwS_8",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5161260000000001,
"lat": 51.43351299999999
}
}
}, {
"price_level": 2,
"id": "d14c61ebdd02e62fead214e572c485377f316b4e",
"place_id": "ChIJ8w4pRCxxdkgR-EjxjBpN0Cw",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/shopping-71.png",
"vicinity": "The Elmsleigh Centre, Staines",
"scope": "GOOGLE",
"name": "BHS",
"types": ["department_store", "cafe", "furniture_store", "food", "clothing_store", "home_goods_store", "store", "point_of_interest", "establishment"],
"reference": "CmRWAAAAzsQp2HyVGIfFYFp91gzTwRl4VWMnseG5gWgTTIaUQxkz1t4gBtgBuT2IS0YfP_sbiW5EYF1ckAylGiHOAwbCSn8PzR9ZtvidlqthaedtBw1Zzyb9wuDhc0ZlGfqGsda5EhBIzSCFhLSW-q2xgtXx-dacGhSuesshpeC8E1VuvwVp-ZSk2xMM5A",
"opening_hours": {
"open_now": false,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5085529999999999,
"lat": 51.433334
}
}
}, {
"price_level": 2,
"id": "f105b9b420a01219419d02d18daa0410624eb3f4",
"place_id": "ChIJk2UX8StxdkgRnxSmGXppSCs",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "Tillys Lane Two Rivers, Staines",
"scope": "GOOGLE",
"name": "ASK Italian",
"rating": 3.5,
"types": ["restaurant", "food", "point_of_interest", "establishment"],
"reference": "CmReAAAAkk6O9EFvti2PF1mJY6hq980CC5Kr_ri-di2Wa8k9mKdiwbTHTZCkhRiTTFDbsqNSXNq6L70MXoR4mQJjl8g_2bB18V7EZRE6QjTSl6kuL5_ZYadSaq9DzchfbTfe_AunEhArkMuVbTqxFtzPTBobcuG-GhQumQkrD7-Ud2M9bfJhiviJ6MavYg",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5123499999999999,
"lat": 51.43433199999999
}
}
}, {
"id": "7b54360eae065f533b85008a3c1faf269f54d552",
"place_id": "ChIJzdWTFzJxdkgRO0wmYv2IaB4",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "3-5 Kingston Road, Staines",
"scope": "GOOGLE",
"name": "Asiana Buffet Restaurant",
"rating": 3.9,
"types": ["restaurant", "food", "point_of_interest", "establishment"],
"reference": "CnRrAAAAAaeyEjCRhYrS3DnFejyH568mzyyuma83Z1DymGCxeQqBsfyVYcc_ak95rpwQaQ-cXhpOZ1dNd8ja8otGhbuQlLp9z74sObvklSo6UfsdzjJHh1FQBswm_dlxG8oFr5SYuoD_WL9wO-mwAqHE-HSshhIQ0R9X-cewcfh_9OeeJ5ovgBoUGz5cpGf0p5TbpSkdRoWXmgXQh6w",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5053695,
"lat": 51.4349768
}
}
}, {
"price_level": 1,
"id": "4e62b72baee5a48491a44b4223e021dcc0d48a22",
"place_id": "ChIJXanH6itxdkgR2ah68H4h_0g",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/bar-71.png",
"vicinity": "2-8 High Street, Staines",
"scope": "GOOGLE",
"name": "The George",
"rating": 3.6,
"types": ["bar", "restaurant", "food", "point_of_interest", "establishment"],
"reference": "CmRdAAAAvSxqEadtFdXYZldumC562VtDAp3wrmkvrGEjLtPrK4tFgVkEQXYxm23ZOwxkNqR0KNkTfsq_A53lmWGgnl2rIaxSlFftal6xRlYVezrwU248aOoDqswg8bfaXseHmDNaEhDVntRxxjiY3kiPRzWlBlxfGhS8nhKAMf7oUGgUSqeIeNNEsRxmOQ",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5133394000000001,
"lat": 51.43366959999999
}
}
}, {
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/116530291411750831786/photos\">Roshni's</a>"],
"photo_reference": "CmRdAAAAxxpQzouTDJRWfZRpZD20HfYWwZVZM7eKYipHcIkAAMC6AObpbNssHoeBaePs4qb073VOThICiqsm-MC8WhSHhQw6vRYQuhyoJg7MrITz1DiiY7ByEaiFjB1Bsh4Gb4uaEhA4IU4OzrEfRHn_wDZ_7zAeGhRPHIuXVSR4LS4gq4eCYVtTc8ty-g",
"width": 760,
"height": 232
}],
"id": "c9812e202ae80911dec13042e28df91f9d20a629",
"place_id": "ChIJ2Qf4QCpxdkgRMxxaQ4C9y0c",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "Unit 1, Thames Edge Court, Clarence Street, Staines-upon-Thames, Staines",
"scope": "GOOGLE",
"name": "Roshni's",
"rating": 3.5,
"types": ["restaurant", "food", "point_of_interest", "establishment"],
"reference": "CmRbAAAAbdU1Zu2NyoCPDAvHfQXu8SJKm8aR6r6AkNYqZK0C7v0LZRTmn_Qy9lo886yHJpM0OCrPCyYLGdvopmaeDPLUvlD8L4s9B1iTKXcxSGYcMt0i300UFWFS8RGByHoAf2OeEhAX4T3ZWZ4fLTRRrYtzpAisGhSm1q6AGfqXKmGyCxzP-QhpA5Ut8A",
"geometry": {
"location": {
"lng": -0.5157103000000001,
"lat": 51.433726
}
}
}, {
"price_level": 2,
"id": "c272273ca42e34a513f45765a4204635200a08d6",
"place_id": "ChIJe3_jeClxdkgRvhT9LHECeU8",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "Hale Street, Staines",
"scope": "GOOGLE",
"name": "Frankie & Bennys",
"rating": 2.8,
"types": ["bar", "store", "restaurant", "food", "point_of_interest", "establishment"],
"reference": "CnRjAAAAbF20Z5ROXxldWhF89F6ycDz3fi-QbfxR8FxuhJ0TGyNZCpvEz8dAT-p7yDgccYzBh4-Aaac1Ut35gnna8oJBpDwJ0Y_gIO9v8KbVuvRXEO3n9g2UYkqTP-AgQu6rbQGAKwJH4JKZD26DSHt465GPyxIQ6-sNggPldvkZ83CcxgKHuhoUQYxR2ZgHGPv5Ap37Dk5lr5NPn_Y",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5145124,
"lat": 51.4356658
}
}
}, {
"price_level": 1,
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/107848784778799147013/photos\">Domino's Pizza</a>"],
"photo_reference": "CmRdAAAArC1ucdEi-oP5_t6uxNgGumbwyBjQ2EFS4-BmasYGtatYijmOx_P2eo-BFBJ5uwQDUu1UIGqgSFW4xGoEnv129pPuAaMRjJrYhCmRxsTJXtTNCS82vNZHyyHf5KEETMSGEhB_J6AAJZ7gdWHPfnd0Wfc1GhRABTVewnZwu6D9QXH9wo9kTE6tmg",
"width": 1000,
"height": 750
}],
"id": "21e0d77c43cde83aaa4fb982174353b482cc68ab",
"place_id": "ChIJjRidCS5xdkgRVQdPiPXSYMk",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"vicinity": "150 High Street, Staines-upon-Thames, Staines",
"scope": "GOOGLE",
"name": "Domino's Pizza",
"types": ["meal_takeaway", "meal_delivery", "restaurant", "food", "point_of_interest", "establishment"],
"reference": "CnRiAAAA46QzBIpSScqiArfdOHF4ZnVkmDdbW_RbKqbjJkmXaxSn0QgZajZk9zh-mWtzHsZHWNEj7IYuFbsJEgYvRVDnNadBF39ulx36FtZAZowmdnir-GgOnKgcYkt47Sqj2B9GcAXhdB1P5X9Y_Qp9Ow7JHBIQ6iUgHMXyuGdyCbq2lR_reRoUavdhngoKSZewYZXmImy7ME8yxG4",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5067579999999999,
"lat": 51.4352866
}
}
}, {
"price_level": 2,
"id": "f8ded1af3929c265a6b702f931a3dcd7e44a852d",
"place_id": "ChIJt-YVxdNwdkgRvM3zWr7QXS4",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"vicinity": "Sainsbury Store, Staines",
"scope": "GOOGLE",
"name": "Starbucks Coffee",
"rating": 4.3,
"types": ["cafe", "bar", "food", "store", "point_of_interest", "establishment"],
"reference": "CnRjAAAAX6x8f7Sqoxwi_jww18wuJ8NOmQE9QEU-2vWIcSQJ2BKsYdMSx2h_FeDcV1GiNINBwJQIsqbB-DlQbPmPSw4h-sqbzxiT8otWsKZpzLF2xp14gWI5oiM3Dsl_f23pUIGp9XovhG9rqqCWa6zKTC70IxIQAJYYmYPBCXXaJOPc2TL5ahoUNfYcl9GU3KyxvvKr5IY6R25-3tk",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5202179,
"lat": 51.4324067
}
}
}, {
"price_level": 1,
"id": "9ce1684653e059124bc30cdd6002ef9eb0bc9e31",
"place_id": "ChIJ5ekJCS5xdkgRUbU1cErJ11g",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"vicinity": "152-154 High Street, Staines-upon-Thames",
"scope": "GOOGLE",
"name": "Pizza Hut Delivery",
"rating": 2.4,
"types": ["meal_takeaway", "restaurant", "meal_delivery", "food", "point_of_interest", "establishment"],
"reference": "CnRlAAAAAU6qIm0ebbciuh6ZHxBw2_vMQnHrX2wy8b2LVJHrj4CzhcAAffodOFatAQPTT6Yrnj8qG4Hs9fwoov8bAu0Wgw4B4SF61MfRuwHMPxvG3PRZM3N4HzPkcKa1bOQiotlp6BZJsLXOtPB1o1yI7X4ocBIQxpkpr_kH7HlhNup_qmLQvBoUhhXSqVJOvwMdMPKTM4EJDYVCrDo",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5066452,
"lat": 51.4353138
}
}
}, {
"price_level": 1,
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/114969123258765041000/photos\">Harvester Two Rivers</a>"],
"photo_reference": "CmRdAAAAhTZO1vUt99j4WePvAqDQXiFsM3kaVIu-NEsWyGgiUtfA1kSMj4uXll0ggqMbPwmSioZVrUss7kX04tkdCXZopBOS8H55YzBcaLINm1jm834jHBNqtBefNXFRoEqfqJonEhAOUhO0mHGmCgHV95JttMViGhTp3vJmokFUBHuPl-HXKcnuo4uUbA",
"width": 960,
"height": 720
}],
"id": "1cf948decf96e3d0eda9aad470fdc76b9a1b5601",
"place_id": "ChIJIzDHMypxdkgR6x74W_fpBQA",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "Unit 4 Tilly's lane,, Staines-upon-Thames",
"scope": "GOOGLE",
"name": "Harvester Two Rivers",
"rating": 3.9,
"types": ["restaurant", "bar", "food", "point_of_interest", "establishment"],
"reference": "CnRmAAAA02M7WF0k0QRxDqW3eJ6a2HiNnUOvAjNkW7kAkRAwUe1VM7C-Wy992nPaYTEnB4mDwWCL52_BW03yFvv7ev2lySf1GHmFUU6-sdcs3RUF36A9E5LXBV4hOGdfl9tJeANrSG88iXj9TzYvd7jdT9FmWBIQdO6GRvTTSKF2zuC9YcQCaBoUnIzea55OGBk6DFAO9G9k9gI8oMo",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5121548,
"lat": 51.4341015
}
}
}, {
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/106372575129585866106/photos\">Porto Ricco</a>"],
"photo_reference": "CmRdAAAA2O2MDQYj0c0C3Qg2upniNJdx1B1yrRm15uXeKf-_uFeRnTPpdm0rqBc7hMWBJf2Da4L3sA4RePDdsKSpot8Uto3pnlxeTAz5EsFWHAveb6ByhrYYmWLoHXGI3ciWwuVxEhDVrmFoa4_Yg_CzurpswHeVGhRmUy4tC2xbI7SMvrR89fBemmoqOg",
"width": 3264,
"height": 2448
}],
"id": "2d121dd2e628bd55cbea26b0ea570d2e48b6d5cf",
"place_id": "ChIJS67u1y1xdkgReRtaHW3cqOU",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "133 High Street, Staines",
"scope": "GOOGLE",
"name": "Porto Ricco",
"rating": 4.1,
"types": ["bar", "restaurant", "food", "point_of_interest", "establishment"],
"reference": "CmRfAAAAaU9PrqjkUQ7qoXfZO02FNs-mAbubVoo4exRvcFHm1UoOu3FrZhSKE8qAkiWFzHXsdsp3u0KhMvVwBP4Zg0sd7r7m_naDeD_DLqptoLVOgQeWmrDaQTafJNnnSzFeIx5MEhDIhHvON9ARZUbpYDAPT2liGhS-2b_Of71zwLFZ8l2Iwor7YutTyA",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5079889,
"lat": 51.4349819
}
}
}, {
"price_level": 2,
"id": "8f82403c0215b5146f7a36b157d8c784ede0b033",
"place_id": "ChIJt-YVxdNwdkgRjP_cHu0rpM8",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png",
"vicinity": "68 High Street, Middlesex, Staines",
"scope": "GOOGLE",
"name": "Starbucks Coffee Staines",
"rating": 3.9,
"types": ["cafe", "bar", "food", "store", "point_of_interest", "establishment"],
"reference": "CnRsAAAAgaUd9K91oHNK4OuQ_1M26qk22bDCjiISJXW8f0WDYleqebQTjuQ56UYRDpECtenctKv0S0NkX66vNhTu8gDJZGs2ffCqmkY72EMhe0TevcsMy0iUHIMtDNCqhgDBgJnRiKic5uCTINAWVj4f5M7LexIQSK74AvBPhr6q7L_k5Puq2hoUhlXPo9CRzIxMOgcG3Hoc0XY5EiY",
"opening_hours": {
"open_now": false,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5107727,
"lat": 51.4343014
}
}
}, {
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/110965052113878483822/photos\">The Ancient Raj</a>"],
"photo_reference": "CmRdAAAAGRQYNaq8kP6ihGFe8dG4W19BCwTTyuaye2RS91dbxfukvgpZcP2TbV5jiM7lFhzVQ_L_a0kLNlKzya3F2EEtIe1A2v2o8guLTZ3sgiIZ_DvT-fRtFN0B6xSYmqLWg4HeEhBjM_fxfJlyymF-o-oalge1GhTwR6-VLz9IdAKn_i7P3Il3nD2epw",
"width": 2048,
"height": 1360
}],
"id": "7b5e91747c01f148ec3927839d32b75b43f98ab5",
"place_id": "ChIJgWna4S1xdkgRtKKrpRNqSlU",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "157 High Street, Staines",
"scope": "GOOGLE",
"name": "The Ancient Raj",
"rating": 3.9,
"types": ["restaurant", "food", "point_of_interest", "establishment"],
"reference": "CnRiAAAAH7mYKrXt-hyr3n9cp_1vW4wR-d_5Jtwf0bs2cHtn8wfi1hkiBgePRLadb8bxNttp7qteThxD80hYkhIHDxZk0mndkauhtEtug9Puv9LYTkpWKAGm0zb96wSn6xdPHpTpbceGJOutQW2FZFD2WXQPDRIQuTh6zuIGbSL4ffKdaAGscxoU7AKiThv9menOt1bE8flFr_a_zSo",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5068440999999999,
"lat": 51.4349755
}
}
}, {
"price_level": 1,
"photos": [{
"html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/111072286929774230843/photos\">The Two Rivers</a>"],
"photo_reference": "CmRdAAAALGuVISdUToO7Pp3h-bXQCjruB1poDySnM09JZVAHbQxJJ6OoYQl4jqJ1WDDndLoUdeNGe_k2MIO_IspNKAB73_UgQ5B76sCHFLprgmYQE_wOKMhxSPkKTnIqTgZTBlYREhDvyjzq9Si8jPA8C7cT8Wp9GhRjc-y5I4XegCwMyRPH9DkX_RnLzg",
"width": 851,
"height": 315
}],
"id": "acb4c03b83c28a96dcf08b4de35e563bb1b820d5",
"place_id": "ChIJdR6gLSpxdkgRt_t0eU2Wjzw",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"vicinity": "Harvester, Tilly's Lane, Staines-upon-Thames, Staines",
"scope": "GOOGLE",
"name": "The Two Rivers",
"types": ["restaurant", "bar", "food", "point_of_interest", "establishment"],
"reference": "CnRhAAAAY2I4odiwwV9JXZzh3Qf9LqNdqbW6ehr_MGcxL89ewrzgIW5OVIwXrSElVEvHGH2VryPkdp9oUPcjt1hGlqmC46YJL30snf664TLTjO87V7Vmbwni2yNbuRf9BYzA7xsoS8i0oVsq_mbonfSfmKPcchIQKc6jLAeP9E9o8s5Co6JlHRoUp1EHGcie_X-lPoAy1d09XU7pqpM",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5121508000000001,
"lat": 51.4340639
}
}
}, {
"id": "4805fa0dd20cd0efeea1473f0b47fe2402f4f7b9",
"place_id": "ChIJE9aLuNJ2dkgRKWUSDrctVmA",
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/bar-71.png",
"vicinity": "35 Edgell Road, Staines",
"scope": "GOOGLE",
"name": "The Beehive Inn",
"rating": 4,
"types": ["restaurant", "food", "bar", "point_of_interest", "establishment"],
"reference": "CnRiAAAAWZY1ABC6_PrqHIxDSzH3ZwOWTFWaj1h41lMGPF2BYk0MTXxEwGeoxXPGx5hGgoW0fs2v1ipZdGAXCvY5n6vceWbIDIUrOz9DHTCXeNVCx8xy5q3Yxo43Ru40BkW3pDT_NRPXyF7XJ9Yunrao6wi4-BIQWWpJKHE9GihMc8efrv0OuRoUfRCaURQysMSkZ_2rlvKPqKctxSY",
"opening_hours": {
"open_now": true,
"weekday_text": []
},
"geometry": {
"location": {
"lng": -0.5069604999999998,
"lat": 51.4290894
}
}
}],
"html_attributions": [],
"status": "OK",
"next_page_token": "CpQCBQEAAC0Ql0Z-M7j4TK1XzNHLSKn_3qW1knjHhDAV-XXF2x34lcIWkaG4coVdxWRpUybCZVEbzR0baEhYtHQk9T3qAXGcqi7KDlcbK8rgqPa1mlyTO2GCjsIyCp0JsoU25WMhqPUkMEZ4toaHJpbZb_b5-cg963QitJHG9viB8DLPpQgfSQzHpVRnnH3Oij_kKqXDhfTOEPfK-Dcu2Ya9F5hvLwOPvg0r4ijCfXqY8MXQL3NpSq6Nxi-xw4vSgUyjoztTBExAZwyGL7Dg88yvhecfV_Dt69dzsTqJJHFdlN4VxI1U1QaahzbO_BadjTVN37VCWP0qK8b4AjPSDN0uGmf1ihYP_3-P63L48GoOtLWwLnH8EhAIeiaaLK0yR1Yj_pmSQPUEGhRi1W06uGhjG8Zc0L_Jj80VMkCciw"
}
答案 0 :(得分:1)
您可以获取数组和长度
JSONArray results = response.getJSONArray(results);
int len = result.length();