【Android教学用例程序】LBS 1

GPS: 通过GPS定位亮起

NET: 通过网络定位亮起

REFESH按钮: 刷新数据

按钮上方:显示定位地图

按钮下方:显示相关数据

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"    >
    <com.baidu.mapapi.map.MapView
        android:id="@+id/bmapView"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:clickable="true" />
    <LinearLayout
        android:orientation = "horizontal"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <RadioButton
            android:id="@+id/radioGPS"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="GPS" />
        <RadioButton
            android:id="@+id/radioNET"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="NET" />
        <Button
            android:id="@+id/btn_refresh"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="Refresh"
            android:layout_weight="1.5"/>
    </LinearLayout>
    <TextView
        android:id="@+id/position_text_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</LinearLayout>
原文地址:https://www.cnblogs.com/hbuwyg/p/7078076.html