Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

activity_public_mqtt.xml 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical"
  6. android:padding="10dp">
  7. <LinearLayout
  8. android:layout_width="match_parent"
  9. android:layout_height="wrap_content"
  10. android:orientation="horizontal">
  11. <Button
  12. android:id="@+id/btnClearShakeHands"
  13. android:layout_width="wrap_content"
  14. android:layout_height="wrap_content"
  15. android:text="清空" />
  16. <TextView
  17. android:id="@+id/tvDeviceList"
  18. android:layout_width="match_parent"
  19. android:layout_height="wrap_content" />
  20. </LinearLayout>
  21. <LinearLayout
  22. android:layout_width="match_parent"
  23. android:layout_height="wrap_content"
  24. android:orientation="horizontal">
  25. <TextView
  26. android:layout_width="wrap_content"
  27. android:layout_height="wrap_content"
  28. android:text="当前APPID:" />
  29. <EditText
  30. android:id="@+id/etAppUserId"
  31. android:layout_width="80dp"
  32. android:layout_height="wrap_content"
  33. android:digits="0123456789"
  34. android:text="1" />
  35. <Button
  36. android:id="@+id/btnConnectMqtt"
  37. android:layout_width="wrap_content"
  38. android:layout_height="wrap_content"
  39. android:text="连接MQTT" />
  40. <Button
  41. android:id="@+id/btnDisconnectMqtt"
  42. android:layout_width="wrap_content"
  43. android:layout_height="wrap_content"
  44. android:text="断开MQTT" />
  45. </LinearLayout>
  46. <LinearLayout
  47. android:layout_width="match_parent"
  48. android:layout_height="wrap_content"
  49. android:orientation="horizontal">
  50. <TextView
  51. android:layout_width="wrap_content"
  52. android:layout_height="wrap_content"
  53. android:text="设备ID:" />
  54. <EditText
  55. android:id="@+id/etDeviceId"
  56. android:layout_width="80dp"
  57. android:layout_height="wrap_content"
  58. android:digits="0123456789"
  59. android:hint="请输入设备ID"
  60. android:text="1" />
  61. <Button
  62. android:id="@+id/btnAddDevice"
  63. android:layout_width="wrap_content"
  64. android:layout_height="wrap_content"
  65. android:text="添加设备" />
  66. <Button
  67. android:id="@+id/btnRemoveDevice"
  68. android:layout_width="wrap_content"
  69. android:layout_height="wrap_content"
  70. android:text="移除设备" />
  71. </LinearLayout>
  72. <LinearLayout
  73. android:layout_width="match_parent"
  74. android:orientation="horizontal"
  75. android:layout_height="wrap_content">
  76. <TextView
  77. android:layout_width="wrap_content"
  78. android:layout_height="wrap_content"
  79. android:text="设备ID:"
  80. />
  81. <EditText
  82. android:id="@+id/etSendDataDeviceId"
  83. android:layout_width="80dp"
  84. android:layout_height="wrap_content"
  85. android:digits="0123456789"
  86. />
  87. <EditText
  88. android:id="@+id/etSendData"
  89. android:layout_width="0dp"
  90. android:layout_weight="1"
  91. android:layout_height="wrap_content"
  92. android:text=""
  93. android:hint="请输入要发送的数据"
  94. android:textSize="12dp"
  95. android:digits="0123456789abcdefABCDEF"
  96. />
  97. <Button
  98. android:id="@+id/btnSendData"
  99. android:layout_width="wrap_content"
  100. android:layout_height="wrap_content"
  101. android:text="发送"
  102. />
  103. </LinearLayout>
  104. <ListView
  105. android:id="@+id/lv_log"
  106. android:layout_width="match_parent"
  107. android:layout_height="match_parent"
  108. android:layout_marginTop="10dp" />
  109. </LinearLayout>