Android高手进阶教程(十五)之---通过Location获取Address的使用!

大家好,上一节我讲了一下如何通过LocationManager来获取Location,没有看过上一节的同学,可以点击如下链接返回查看:

Android高手进阶教程十四之---Android Location的使用!

我们获取Location的目的之一肯定是有获取这个位置的详细地址,而我们有了Location在来获取Address就相对简单多了,因为GoogleApi已经封装好了方法,我们只需呀通过Location获取GeoPoint,然后在通过GeoPoint来获取我们想要的Address.下面是我做的一个简单的Demo.

第一步新建一个Android工程LocationDemo,注意这里选用的是(Google APIs),下面是文件目录结构:


第二步: 修改main.xml(相比第十四节增加了一个address的TextView),代码如下:

第三步:修改LocationDemo.java(增加了两个方法)代码如下:

第四步:最重要一步在AndroidManiefest.xml中导入Google Api(第14行代码)库,代码如下:

第五步:运行上述工程,效果如下图如示:


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Our lifestyle is changing dramatically with the ubiquity of mobile devices and network connectivity. By seamlessly collecting advanced data related to human activity, and providing responsive actions and services to users, developers can maximize the functionality of mobile devices, thereby improving livability, convenience and safety, and ultimately enabling a smart life. The spatial and contextual data, i.e., users’ locations as well as their interaction with the cyber and physical world, has been a decisive driver for the ongoing trend towards smart and connected applications to date. Context-aware location sensing is the cornerstone of this vision. Over the past few years, a broad variety of services have been targeted to revolution- ize how people sense and interact with everyday objects and locations to- wards a smart life. For example, sensor networks provide realtime activity data for heating/air conditioning systems and fire and smoke detectors, GPS and WLAN systems provide way-finding and coarse-grained location services, RFID and short-range communication devices provide proximity detection and awareness. However, these separate and usually proprietary systems are far from satisfactory. The major metrics of these spatial enabling technolo- gies, most notably accuracy, interoperability, and deployability performance, are far from satisfactory. Significant gaps exist in our understanding of how a scalable location sensing system design could meet a multitude of smart application demands. Moreover, no extensible and developer-friendly system frameworks are available for location and smart applications. Developers do not have any testbed or prototype system available for them to play with. Senior developers are reluctant to extend and debug their existing prototype infrastructures since the errors and software deficiencies are hard to identify in the distributed manner. Large-scale deployment is rarely available and hard to share with junior developers for partial or temporal development. xxiii xxiv Towards Mobile SmartLife via Sensing, Localization, & Cloud Ecosystems Our overarching goal is to develop an intellectual framework and a location infrastructure testbed to promote and guide the developers to realize the full- fledged smart applications for a smart lifestyle, to address societal challenges in local communities. We aim to offer a comprehensive book on a complete mobile system design for SmartLife applications. This book is structured to be a complete and updated guide for building the ecosystem step by step from the hardware to mobile apps, to the cloud processing and service back- end. Beginners can start from the initial introductory and tutorial chapters while advanced readers can learn directly from the algorithms and prototype design. Practitioners can find inspiration for utilizing the proposed localization techniques in a variety of mobile applications including shopping map, indoor navigation, visitor guide, augmented reality, and location-based social-aided sensing/sourcing. We have tested and verified the information in this book to the best of our ability, but you may find that features have changed (which may in fact resemble bugs). Please let us know about any errors you find, as well as your suggestions for future editions, by writing to the following address. Please get in touch ([email protected]) if you know of services that are missing, or have other questions or suggestions. I hope this book will give you a good head start and that you have fun in the process.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值