毕业论文

打赏
当前位置: 毕业论文 > 计算机论文 >

Android的健康指标检测系统的App设计(6)

时间:2020-03-06 21:37来源:毕业论文
Integer.parseInt(edit_heart_h.getText().toString()); System.out.println(temp_low:+temp_low); System.out.println(temp_high:+temp_high); System.out.println(heart_low:+heart_low); System.out.println(hear


      Integer.parseInt(edit_heart_h.getText().toString());
        System.out.println("temp_low:"+temp_low);
        System.out.println("temp_high:"+temp_high);
        System.out.println("heart_low:"+heart_low);
        System.out.println("heart_high:"+heart_high);
以上代码作用:因为原装的Android标配栏配色比较单调,就是黑色的一坨,现在我开发的软件需要独自添加标题栏,所以需要设置自定义标题,这样不仅美观而且可以将进度条等加进去。
  3、界面布局;
   界面布局配置文件管理,因为本设计中并不需要多么花哨的界面效果,所有布局相对来说比较简单,一般来说,app中有多少个活动界面,就需要多少布局文件。具体效果可以在运行及测试中看到。其开发界面如图3-2。
 
图3.2 图形开发界面
如上图,界面上有标题“基于物联网的体征检测系统”、报警电话“10086”、体温和脉搏以及它们的区间范围。最下端有查看数据按钮、更新范围按钮、删除数据按钮和退出按钮。
3.2.2 蓝牙服务模块
部分代码如下,全部代码见附录。
    private final BluetoothAdapter mAdapter;
    private final Handler mHandler;
    private AcceptThread mAcceptThread;
    private ConnectThread mConnectThread;
    private ConnectedThread mConnectedThread;
    private int mState;
// Constants that indicate the current connection state
    public static final int STATE_NONE = 0;       // we're doing nothing
    public static final int STATE_LISTEN = 1;     // now listening for incoming connections
    public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection
public static final int STATE_CONNECTED = 3;  // now connected to a remote device
    以上代码的作用是获取蓝牙适配器,如果BluetoothAdapte为null,说明Android手机没有蓝牙。True表示蓝牙已开启,false表示蓝牙没有开启。
3.2.3 设备栏界面
部分代码如下,其它代码见附录。
  public class DeviceListActivity extends Activity
  {
    // Debugging
    private static final String TAG = "DeviceListActivity";
    private static final boolean D = true;
   // Return Intent extra
    public static String EXTRA_DEVICE_ADDRESS = "device_address";
   // Member fields
    private BluetoothAdapter mBtAdapter;
    private ArrayAdapter<String> mPairedDevicesArrayAdapter;
    private ArrayAdapter<String> mNewDevicesArrayAdapter;
   @SuppressLint({ "NewApi", "NewApi", "NewApi", "NewApi", "NewApi" })
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
以上代码的作用就是定义界面上各个按钮的位置、设置窗口及搜索附近的蓝牙设备。
3.3 本章总结
本章主要介绍了本次设计所需要的开发环境、软件的整体结构和各功能的模块设计。完成这些,也基本上完成了本次设计。接下来只要和林静的硬件结合,就能完成对软件的测试。测试成功的话,就能利用该App对人体的温度脉搏进行监测。  Android的健康指标检测系统的App设计(6):http://www.youerw.com/jisuanji/lunwen_47638.html
------分隔线----------------------------
推荐内容