Przeglądaj źródła

修改TCP启动按钮的布局,删除一些不必要的代码
TCP连接的稳定性还要再改改,断开重连连不上的问题还有

robbin 4 lat temu
rodzic
commit
c27f147970

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 3 - 50
app/src/main/java/com/example/administrator/wingcool_gt9_apk/GT9MainActivity.java

@@ -98,8 +98,7 @@ public class GT9MainActivity extends AppCompatActivity
 
     public static List<Activity> activityList = new LinkedList();
 
-    private Button bt_tcpstart, bt_tcpsend1;
-    private EditText et_text, et_text1;
+    private Button bt_tcpstart;
     private final static String TAG = "Main2Activity-------->";
     private final static String addreeip = "192.168.3.80";
     private final static int port = 5555;
@@ -111,7 +110,7 @@ public class GT9MainActivity extends AppCompatActivity
     private OutputStream outputStream = null;
     private InputStream inputStream = null;
 
-    private byte[] SyncCmd = new byte[] {0x03, 0x00, 0x13, (byte)0x81, 0x4E, 0x00, 0x01};
+    private byte[] SyncCmd = new byte[] {0x03, 0x00, 0x0d, (byte)0x81, 0x4E, 0x00, 0x01};
 
     Handler mHandler = new Handler() {
         @Override
@@ -229,16 +228,8 @@ public class GT9MainActivity extends AppCompatActivity
 
         bt_tcpstart = findViewById(R.id.bt_tcpstart);
 
-        bt_tcpsend1 = findViewById(R.id.bt_tcpsend1);
-
-        et_text = findViewById(R.id.et_text);
-
-        et_text1 = findViewById(R.id.et_text1);
-
         bt_tcpstart.setOnClickListener(this);
 
-        bt_tcpsend1.setOnClickListener(this);
-
         init();//
     }
 
@@ -395,8 +386,6 @@ public class GT9MainActivity extends AppCompatActivity
 
 
 
-
-
     @Override
     public void onClick(final View v) {
         switch (v.getId()) {
@@ -456,7 +445,6 @@ public class GT9MainActivity extends AppCompatActivity
                                         framelen = (headbytes[4] & 0xff) + (int) ((headbytes[5] & 0xff) * 256);  //低位在前
                                         frameid = (headbytes[6] & 0xff) + (int) ((headbytes[7] & 0xff) * 256);
 
-
                                         int offset = 0;
 
                                         do{
@@ -504,10 +492,8 @@ public class GT9MainActivity extends AppCompatActivity
                                     System.out.println(sb);
                                     */
                                 }
-                                // System.out.println("get message from client: " + sb);
 
                                 //outputStream = socket.getOutputStream();
-                                //outputStream.write("Hello Client,I get the message.".getBytes("UTF-8"));
 
                                 inputStream.close();
                                 outputStream.close();
@@ -529,7 +515,6 @@ public class GT9MainActivity extends AppCompatActivity
                     //bt_tcpstart.setBackgroundColor(getResources().getColor(R.color.colorAccent2));
 
                     try {
-                        //socket.close();
                         //inputStream.close();
                         //outputStream.close();
                         //socket.close();
@@ -542,43 +527,11 @@ public class GT9MainActivity extends AppCompatActivity
 
                 break;
 
-            case R.id.bt_tcpsend1:
-                tcp_start();
+            default:
                 break;
         }
     }
 
-    private void tcp_start() {
-
-        new Thread(new Runnable() {
-
-            @Override
-
-            public void run() {
-                app_text = et_text.getText().toString().trim();
-                try {
-
-                    if (app_text.equals("")) {
-                        Log.i(TAG, "输入不能为空");
-                    } else {
-                        //注意charset.forName 字符编码,utf-8中文。。。。。
-                        if(outputStream !=null){
-                            byte[] sendData = app_text.getBytes(Charset.forName("ASCII"));
-                            outputStream.write(sendData, 0, sendData.length);
-                            outputStream.flush();
-
-                        }
-                    }
-
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-
-            }
-
-        }).start();
-    }
-
     /**
      * ???? , ??????????
      */

+ 23 - 31
app/src/main/res/layout-hdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-land-hdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-land-mdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-land-xhdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-land-xxhdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-land-xxxhdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-land/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-mdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-xhdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-xxhdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout-xxxhdpi/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 23 - 31
app/src/main/res/layout/activity_gt9_main.xml

@@ -174,7 +174,7 @@
             </LinearLayout>
 
             <Button
-                android:id="@+id/readtext"
+                android:id="@+id/bt_tcpstart"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginStart="8dp"
@@ -184,6 +184,28 @@
                 android:layout_marginRight="8dp"
                 android:layout_marginBottom="0dp"
                 android:background="@drawable/bg_mainactivity_buttonframe_line"
+                android:text="TCP启动"
+                android:textColor="#FFFFf0"
+                android:textAllCaps="false"
+                android:textSize="30dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.535"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="0.196" />
+
+            <Button
+                android:id="@+id/readtext"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="0dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="0dp"
+                android:background="@drawable/bg_mainactivity_buttonframe_line"
                 android:onClick="ConfigSetting"
                 android:text="@string/configsetting"
                 android:textColor="#FFFFf0"
@@ -379,36 +401,6 @@
                 app:layout_constraintTop_toTopOf="parent"
                 app:layout_constraintVertical_bias="0.376" />
 
-            <EditText
-                android:id="@+id/et_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="请输入信息" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <Button
-                    android:id="@+id/bt_tcpstart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="TCP启动" />
-
-                <Button
-                    android:id="@+id/bt_tcpsend1"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="发送" />
-            </LinearLayout>
-
-            <EditText
-                android:id="@+id/et_text1"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:hint="接收服务器返回来的信息" />
-
         </LinearLayout>
 
     </ScrollView>

+ 2 - 1
app/src/main/res/values-en/strings.xml

@@ -3,6 +3,7 @@
     <string name="connectdevice">Please Connect Device</string>
     <string name="connected">S81x is connected</string>
     <string name="disconnected">S81x is disconnected</string>
+    <string name="tcpstart">TCP Start</string>
     <string name="configsetting">Config Setting</string>
     <string name="firmwareupdata">Firmware Updata</string>
     <string name="dataanalysis">Data Analysis</string>
@@ -78,7 +79,7 @@
     <string name="companyaddr">Address:Room 2008, Chuangxingda Business Building, No.36 Liuxian 3rd Road, Baoan District, Shenzhen</string>
     <string name="telephonenum">Telephone:186 8896 1937</string>
     <string name="emailaddr">Email:max@wingcool.cn</string>
-    <string name="version">APK Version:v0.0.0.1_20200818-Internal Version</string>
+    <string name="version">APK Version:v0.0.0.1_20210408-Internal Version</string>
 
     <string name="app_name">WingCool(GT9)</string>
     <string name="input_num_character">0123456789ABCDEFabcdef</string>

+ 2 - 1
app/src/main/res/values/strings.xml

@@ -2,6 +2,7 @@
     <string name="companyname">深圳前海云鼓科技有限公司</string>
     <string name="connectdevice">请 连 接 设 备</string>
     <string name="connected">S81x 已 连 接</string>
+    <string name="tcpstart">TCP 启 动</string>
     <string name="disconnected">S81x 已 断 开</string>
     <string name="configsetting">Config 设 置</string>
     <string name="firmwareupdata">固 件 下 载</string>
@@ -77,7 +78,7 @@
     <string name="companyaddr">地址:深圳市宝安区留仙三路 36 号创兴达商务大厦 2008 室</string>
     <string name="telephonenum">电话:186 8896 1937</string>
     <string name="emailaddr">邮箱:max@wingcool.cn</string>
-    <string name="version">APK版本:v0.0.0.1_20200818-内部版本</string>
+    <string name="version">APK版本:v0.0.0.1_20210408-内部版本</string>
 
     <string name="app_name">WingCool(GT9)</string>
     <string name="input_num_character">0123456789ABCDEFabcdef</string>