现在Google latitude API消失了,有没有办法访问Google+位置数据?我想做一些基于我的手机位置的脚本,但我在他们的API文档中看不到方法。也许我错过了什么?
谢谢,扎克
发布于 2013-11-15 03:54:01
你可以通过安卓google-play-services软件开发工具包获取手机的位置。您需要在Eclipse中设置一个google-play-services_lib项目作为库项目,然后将该项目作为库导入到您的location应用程序中。
http://developer.android.com/google/play-services/setup.html
不幸的是,让google-play-services在Eclipse中工作并不是那么简单,错误消息也不是很详细。如果您在设置库时遇到问题,请阅读以下内容:
Importing google-play-service library showing a red X next to this reference android
一旦它在Eclipse中工作,你就可以使用google-play-services来获得你的GPS坐标:
http://developer.android.com/guide/topics/location/strategies.html http://developer.android.com/training/location/index.html http://developer.android.com/reference/com/google/android/gms/location/package-summary.html
我没有试过这个,它已经有几年的历史了。对于你正在做的事情来说,这可能会更好,因为你不必处理设置Google Play服务的问题:
http://webdesignergeeks.com/mobile/android/geting-current-location-in-android-application-using-gps/
https://stackoverflow.com/questions/19986661
复制相似问题