最近项目中用到了,经纬度转为地理位置,特列一下,
第一步:下载百度的sdk 申请key 在AndroidManifest.xml 中配置
<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="D4MwcXArk8I5ppFDvYQR7o8f" />
第二步: 就可以使用了
1.列出xml文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.locationdemo.MainActivity" >
<TextView
android:id="@+id/tv_loc_info"
android:layou