AndroidGPS定位详解 (4)
16lz
2021-12-04
为了便于理解,接下来模拟一个案例,如何在程序代码中使用GPS获取位置信息。
第一步:新建一个Android工程项目,命名为mygps,目录结构如下
第二步:修改main.xml布局文件,修改内容如下:
<? xml version="1.0" encoding="utf-8" ?>
< LinearLayout xmlns:android ="http://schemas.android.com/apk/res/android"
androidrientation ="vertical"
android:layout_width ="fill_parent"
android:layout_height ="fill_parent" >
< EditText android:layout_width ="fill_parent"
android:layout_height ="wrap_content"
android:cursorVisible ="false"
android:editable ="false"
android:id ="@+id/editText" />
</ LinearLayout >
第一步:新建一个Android工程项目,命名为mygps,目录结构如下
第二步:修改main.xml布局文件,修改内容如下:
<? xml version="1.0" encoding="utf-8" ?>
< LinearLayout xmlns:android ="http://schemas.android.com/apk/res/android"
androidrientation ="vertical"
android:layout_width ="fill_parent"
android:layout_height ="fill_parent" >
< EditText android:layout_width ="fill_parent"
android:layout_height ="wrap_content"
android:cursorVisible ="false"
android:editable ="false"
android:id ="@+id/editText" />
</ LinearLayout >
更多相关文章
- 8 Android平台开发-WIFI 驱动移植 -- 详细
- Android(安卓)如何使用log4j及注意事项
- android 设置 永不休眠
- Android(安卓)Launcher3一些默认修改
- Android控件之Textiew的使用
- android 5.1禁止休眠
- Android(安卓)Zxing修改为竖屏扫描,和连续扫描问题
- Android出现adb device offline
- Transport endpoint is not connected 报错