如何使用谷歌API搜索附近的地方?

时间:2016-06-09 11:44:07

标签: android

我正在尝试搜索附近的地方,但它什么都没有。 我正在使用浏览器密钥进行api调用和清单android api密钥

pzz帮助我。

06-09 16:55:40.626 22228-22228/com.example.training.googlemappractice E/Zygote: MountEmulatedStorage()
06-09 16:55:40.626 22228-22228/com.example.training.googlemappractice E/Zygote: v2
06-09 16:55:40.641 22228-22228/com.example.training.googlemappractice E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
06-09 16:56:11.186 22228-22228/com.example.training.googlemappractice E/MotionRecognitionManager: mSContextService = null
06-09 16:56:11.186 22228-22228/com.example.training.googlemappractice E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@8a3456f
06-09 16:56:11.561 22228-22228/com.example.training.googlemappractice E/MotionRecognitionManager: mSContextService = null
06-09 16:56:11.561 22228-22228/com.example.training.googlemappractice E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@2391e96b
06-09 16:56:11.686 22228-22228/com.example.training.googlemappractice E/location: null
06-09 16:56:13.596 22228-23275/com.example.training.googlemappractice E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates.ModuleDescriptor" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.example.training.googlemappractice-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
06-09 16:56:22.066 22228-22228/com.example.training.googlemappractice E/ViewRootImpl: sendUserActionEvent() mView == null
06-09 16:56:22.656 22228-22228/com.example.training.googlemappractice E/url-------//: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=0.0,0.0&radius=5000&types=mosque&sensor=true&key=MY_KEY
06-09 16:56:24.031 22228-23481/com.example.training.googlemappractice E/dataStreem------: buffer(com.android.okio.GzipSource@3059bd27).inputStream()
06-09 16:56:24.031 22228-23481/com.example.training.googlemappractice E/data1----: {   "html_attributions" : [],   "results" : [],   "status" : "ZERO_RESULTS"}
06-09 16:56:24.031 22228-23481/com.example.training.googlemappractice E/data------: {   "html_attributions" : [],   "results" : [],   "status" : "ZERO_RESULTS"}
06-09 16:56:24.051 22228-22228/com.example.training.googlemappractice E/list------------: []

1 个答案:

答案 0 :(得分:0)

在Logcat中,您的位置链接是 -

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=0.0,0.0&radius=5000&types=mosque&sensor=true&key=AIzaSyAEZ252ulUWkOIKtJw9O7JvrYz3RLp0N_c

请注意位置参数 - 您的纬度和经度值为0.0,Google响应也为NULL。这样你就无法在地图上看到地点。尝试调试您的纬度和放大器经度值并检查您的位置传感器(GPS)是否打开/关闭。希望它会有所帮助!