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

Android 如何用谷歌API搜索附近的地方?,android,Android,我试着搜索附近的地方,但什么也找不到。 我正在为api调用和清单android api键使用浏览器键 请帮帮我 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

我试着搜索附近的地方,但什么也找不到。 我正在为api调用和清单android api键使用浏览器键

请帮帮我

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------------: []

在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响应也为空。这样你们就看不到地图上的地方了。尝试调试纬度和经度值,并检查位置传感器(GPS)是否打开/关闭。希望这会有帮助

请粘贴logcat,你检查过你的另一部手机上是否有正确的互联网连接吗?是的,它在我的手机上正常工作,但在其他手机上没有。谷歌地图处于活动状态??我的意思是你能看到加载的地图吗?请帮助我们了解你正在执行的详细步骤,以便正确指导你的位置管理器位置管理器=(位置管理器)getSystemService(位置服务);标准=新标准();最终字符串提供程序=locationManager.getBestProvider(条件为true);Location Location=locationManager.getLastKnownLocation(提供者);启用您的GPS!然后应用程序将自动找到您的当前位置。在半径5公里范围内,将显示您的位置类别。我从当前位置获取lat long,返回null,我手动将其放入api中,它现在正在工作。请发送一些代码示例以获取当前位置…您需要使用FusedLocationProviderAPI获取位置。请检查-并作为参考。如果成功,请接受我的回答:)