diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/f/7/f7730cde41931660f06cfc32899edf44acf4d104 b/src/sixaunyi/.idea/sonarlint/issuestore/f/7/f7730cde41931660f06cfc32899edf44acf4d104
deleted file mode 100644
index 77f57c1..0000000
--- a/src/sixaunyi/.idea/sonarlint/issuestore/f/7/f7730cde41931660f06cfc32899edf44acf4d104
+++ /dev/null
@@ -1,10 +0,0 @@
-
-k	java:S117'"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ߏ�������
-q
-java:S1450"[Remove the "mLoginButton" field and declare it as a local variable in the relevant methods.(��Ձ
-t
-java:S1171"YMove the contents of this initializer to a standard constructor or to field initializers.(��������
-G
-java:S1602 ",Remove useless curly braces around statement(��������
-V
-java:S11263"AReplace this if-then-else statement by a single return statement.(ց�z
\ No newline at end of file
diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/index.pb b/src/sixaunyi/.idea/sonarlint/issuestore/index.pb
index 00e75a7..bd69223 100644
--- a/src/sixaunyi/.idea/sonarlint/issuestore/index.pb
+++ b/src/sixaunyi/.idea/sonarlint/issuestore/index.pb
@@ -22,6 +22,4 @@ j
 j
 :app/src/main/java/com/example/sixaunyi/DetectActivity.java,9\6\9668392b13e33166876f2a7d3f10eb5405e757ad
 k
-;app/src/main/java/com/example/sixaunyi/ControlActivity.java,c\9\c99a584c2117ed2df42496451bb97ac1147f5ea0
-i
-9app/src/main/java/com/example/sixaunyi/LoginActivity.java,f\7\f7730cde41931660f06cfc32899edf44acf4d104
\ No newline at end of file
+;app/src/main/java/com/example/sixaunyi/ControlActivity.java,c\9\c99a584c2117ed2df42496451bb97ac1147f5ea0
\ No newline at end of file
diff --git a/src/sixaunyi/app/src/main/AndroidManifest.xml b/src/sixaunyi/app/src/main/AndroidManifest.xml
index a874084..844cd7a 100644
--- a/src/sixaunyi/app/src/main/AndroidManifest.xml
+++ b/src/sixaunyi/app/src/main/AndroidManifest.xml
@@ -51,6 +51,7 @@
         <activity
             android:name=".MainActivity"
             android:exported="true"
+            android:launchMode="singleInstance"
             android:label="@string/app_name"
             android:theme="@style/Theme.AppCompat">
         </activity>
diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/LoginActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/LoginActivity.java
index 7531f91..5ba1712 100644
--- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/LoginActivity.java
+++ b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/LoginActivity.java
@@ -1,8 +1,12 @@
 package com.example.sixaunyi;
 import android.app.Activity;
+import android.content.Context;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
 import android.widget.EditText;
 import android.widget.Toast;
 import androidx.appcompat.app.AppCompatActivity;
@@ -14,6 +18,8 @@ public class LoginActivity extends AppCompatActivity {
     private EditText mUsername;
     private EditText mPassword;
     private Button mLoginButton;
+    private CheckBox Account_remember;
+    private SharedPreferences sharedPreferences;
     private Map<String, String> mUsers = new HashMap<>();
     {
         mUsers.put("admin", "123456");
@@ -28,6 +34,14 @@ public class LoginActivity extends AppCompatActivity {
         mUsername = findViewById(R.id.username);
         mPassword = findViewById(R.id.password);
         mLoginButton = findViewById(R.id.login);
+        Account_remember = findViewById(R.id.remember_check);
+        sharedPreferences = getSharedPreferences("account", Context.MODE_PRIVATE);
+        String username = sharedPreferences.getString("username", "");
+        String password =sharedPreferences.getString("password", "");
+        boolean isChecked = sharedPreferences.getBoolean("checkbox_state", false);
+        mUsername.setText(username);
+        mPassword.setText(password);
+        Account_remember.setChecked(isChecked);
         // 设置登录按钮的点击事件
         mLoginButton.setOnClickListener(v -> {
             attemptLogin();
@@ -38,15 +52,23 @@ public class LoginActivity extends AppCompatActivity {
         String password = mPassword.getText().toString();
         boolean if_correct = verifyUser(username,password);
         if (if_correct) {
+            SharedPreferences.Editor editor = sharedPreferences.edit();
+            editor.putString("username", username);
+            editor.putBoolean("checkbox_state", Account_remember.isChecked());
+            editor.apply();
+            if (Account_remember.isChecked()){
+                editor.putString("password", password);
+            }else{
+                editor.putString("password", "");
+            }
+            editor.apply();
             Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show();
             Intent intent = new Intent(LoginActivity.this, MainActivity.class);
             startActivity(intent);
-            finish(); // 关闭登录界面
         } else {
             Toast.makeText(this, "用户名或密码错误", Toast.LENGTH_SHORT).show();
         }
     }
-
     private boolean verifyUser(String username, String password){
         if (mUsers.containsKey(username) && mUsers.get(username).equals(password)) {
             return true;
diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java
index 23fdf80..c2faa9b 100644
--- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java
+++ b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java
@@ -527,6 +527,7 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
     public void changeAct(View view) {
         udpReceiveThread.stopListening();
         Intent intent = new Intent(MainActivity.this, VideoActivity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
         Bundle b = new Bundle();
         b.putString("Angle", MonitorAngle);
         b.putFloat("Distance", MonitorDistance);
@@ -640,7 +641,7 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
                     Log.d(TAG, "Received data: " + receivedString);
                     if (receivedString.equals(mExpectedData)) {
                         Log.i(TAG, "run: 222222222222222222222222222");
-                        sendCommand("WARNING");
+                        sendCommand("WARNING "+String.valueOf(udpMonitorDistance)+" "+udpMonitorAngle);
                         Context context = MainActivity.this;
                         showAlert(context,"传感器报警");
                         addDroneMarker();
diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java
index 28d4e07..b1c91be 100644
--- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java
+++ b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java
@@ -23,6 +23,7 @@ import android.os.Message;
 import android.provider.ContactsContract;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
@@ -35,6 +36,8 @@ import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;
 
+import org.json.JSONException;
+import org.json.JSONObject;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -44,10 +47,10 @@ import java.net.InetAddress;
 import java.net.*;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-
 import android.os.Bundle;
 import android.widget.ToggleButton;
 
+
 public class VideoActivity extends AppCompatActivity {
     private final static String SEND_to_IP = "192.168.39.47"; //填写接收方IP
     private final static String Recieve_IP = "192.168.39.47";//填服务器IP，与send_to_IP为同一个
@@ -76,12 +79,17 @@ public class VideoActivity extends AppCompatActivity {
     private ImageButton TakeOff_btn;
     private ImageButton Landing_btn;
     private ToggleButton Mode_btn;
+    private ImageButton selfHome_btn;
     private String mangle;
     private float mdistance;
     // 创建一个可缓存的线程池
     private ExecutorService mThreadPool = Executors.newCachedThreadPool();
     private UdpDataThread warning_thread;
     private TextView battery_warning;
+    private ImageButton show_status;
+    private String batteryStatus="未获取";
+    private String speedStatus="未获取";
+    private String distanceStatus="未获取";
     //ReceiveData()显示到imageView
     //manager部分：打开线程，接收
     //model部分：发送视频流
@@ -103,7 +111,26 @@ public class VideoActivity extends AppCompatActivity {
         TakeOff_btn = findViewById(R.id.takeoff_button);
         Mode_btn = findViewById(R.id.toggleButton2);
         Setting_btn = findViewById(R.id.setting_button);
+        Setting_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(VideoActivity.this, SettingActivity.class);
+                startActivity(intent);
+            }
+        });
+        selfHome_btn = findViewById(R.id.self_home);
+        selfHome_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                try {
+                    sendCommand("DIRECTHOME");
+                } catch (UnknownHostException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
         battery_warning =findViewById(R.id.warning);
+        show_status=findViewById(R.id.show_status_button);
         battery_warning.setTextColor(Color.RED);
         Animation anim = new AlphaAnimation(0.0f, 1.0f);
         anim.setDuration(500); // 闪烁时间间隔
@@ -121,6 +148,13 @@ public class VideoActivity extends AppCompatActivity {
         } catch (UnknownHostException e) {
             throw new RuntimeException(e);
         }
+        show_status.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                // 在这里编写 ImageButton 的点击事件处理逻辑
+                showPopup(speedStatus,batteryStatus,distanceStatus);
+            }
+        });
     }
     private void Control_Button_Init(){
 
@@ -147,16 +181,16 @@ public class VideoActivity extends AppCompatActivity {
             }
         });
         Forward_btn.setOnClickListener(new View.OnClickListener() {
-           @Override
-           public void onClick(View v) {
-               try {
-                   sendCommand("FORWARD");
-               } catch (UnknownHostException e) {
-                   throw new RuntimeException(e);
-               }
-               Log.i(TAG, "onClick: FFFFFFFForward");
-           }
-       });
+            @Override
+            public void onClick(View v) {
+                try {
+                    sendCommand("FORWARD");
+                } catch (UnknownHostException e) {
+                    throw new RuntimeException(e);
+                }
+                Log.i(TAG, "onClick: FFFFFFFForward");
+            }
+        });
         Back_btn.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -234,13 +268,7 @@ public class VideoActivity extends AppCompatActivity {
                 Log.i(TAG, "onClick: TTTTTTTTTTTTurnRRRRRRRRRRight");
             }
         });
-        Setting_btn.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                Intent intent = new Intent(VideoActivity.this, SettingActivity.class);
-                startActivity(intent);
-            }
-        });
+
     }
 
     private void Condition_Init() throws UnknownHostException {
@@ -304,7 +332,6 @@ public class VideoActivity extends AppCompatActivity {
             super.handleMessage(msg);
         }
     }
-
     /*
      *   UDP数据接受线程
      * */
@@ -375,7 +402,6 @@ public class VideoActivity extends AppCompatActivity {
                 // 创建 DatagramSocket 对象并发送数据报文
                 DatagramSocket socket = new DatagramSocket();
                 socket.send(packet);
-
                 // 关闭 DatagramSocket 对象
                 socket.close();
             } catch (IOException e) {
@@ -393,14 +419,14 @@ public class VideoActivity extends AppCompatActivity {
     }
 
     /*
-    *UDP数据接收线程
+     *UDP数据接收线程
      */
     public class UdpDataThread extends Thread {
         private DatagramSocket socket;
         private boolean running;
         private byte[] buffer;
         private static final int BUFFER_SIZE = 1024; // 设置接收缓冲区大小
-
+        private JSONObject jsonObject;
         public UdpDataThread() {
             buffer = new byte[BUFFER_SIZE];
         }
@@ -408,21 +434,26 @@ public class VideoActivity extends AppCompatActivity {
         @Override
         public void run() {
             running = true;
-
             try {
                 socket = new DatagramSocket(6666); // 设置接收端口号
                 while (running) {
                     DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
                     socket.receive(packet);
-                    String receivedData = new String(packet.getData(), 0, packet.getLength());
-                    if (receivedData.equals("电量低于10%")) {
-                        battery_warning.setText(receivedData);}else{
+                    String receivedData = new String(packet.getData(), 0, packet.getLength(), "UTF-8");
+                    jsonObject = new JSONObject(receivedData);
+                    batteryStatus = jsonObject.getString("battery");
+                    speedStatus = jsonObject.getString("speed");
+                    distanceStatus = jsonObject.getString("distance");
+                    if (batteryStatus.equals("10")) {
+                        battery_warning.setText("电量仅剩"+batteryStatus);}else{
                         battery_warning.setText("");
                     }
-                    System.out.println("接收到数据：" + receivedData);
+                    System.out.println("接收到数据：" + batteryStatus);
+                    System.out.println("接收到数据：" + speedStatus);
+                    System.out.println("接收到数据：" + distanceStatus);
                     // 在这里处理收到的数据，可以根据实际需求进行解析或其他操作
                 }
-            } catch (IOException e) {
+            } catch (IOException | JSONException e) {
                 e.printStackTrace();
             } finally {
                 if (socket != null) {
@@ -435,43 +466,29 @@ public class VideoActivity extends AppCompatActivity {
             running = false;
         }
     }
-    //初始化UDP发送线程
-//    private static void sendCommand(String Sendstr) throws UnknownHostException {
-//        InetAddress sendIP = InetAddress.getByName(SEND_to_IP);  // 目标 IP 地址
-//        int sendPort = 8888;  // 目标端口号
-//        byte[] sendData = Sendstr.getBytes();  // 要发送的数据
-//        UdpSendThread sendCommandThread = new UdpSendThread(sendIP, sendPort, sendData);  // 创建新的线程对象
-//        sendCommandThread.start();  // 启动线程发送数据
-//    }
-
-
-
-
-
-//设置按钮
-//    public void showDialog(View view) {
-//        Dialog dialog = new Dialog(VideoActivity.this);
-//        dialog.setContentView(R.layout.dialog_takeoff);
-//
-//        SlideUnlockView slideUnlockView = (SlideUnlockView) dialog.findViewById(R.id.slide_unlock_view);
-//        slideUnlockView.setOnUnlockListener(new SlideUnlockView.OnUnlockListener() {
-//            @Override
-//            public void onUnlock() {
-//                // 在用户滑动解锁后执行操作
-////                try {
-////                    sendCommand("TAKEOFF"+"___"+angle+"___"+String.valueOf(distance));
-////                } catch (UnknownHostException e) {
-////                    throw new RuntimeException(e);
-////                }
-//                UdpReceiveThread udpReceiveThread = new UdpReceiveThread();
-//                udpReceiveThread.start();
-//
-//                Log.i(TAG, "onClick: 2222222222222222222222222");
-//
-//            }
-//        });
-//        dialog.show();
-//    }
+    public void showPopup(String speedStatus,String batteryStatus,String distanceStatus) {
+        AlertDialog.Builder builder = new AlertDialog.Builder(this);
+        LayoutInflater inflater = getLayoutInflater();
+        View dialogView = inflater.inflate(R.layout.custom_dialog, null);
+        TextView speedstatus = dialogView.findViewById(R.id.speed);
+        speedstatus.setText("当前速度为："+speedStatus);
+        TextView batterystatus = dialogView.findViewById(R.id.battery);
+        batterystatus.setText("当前电量为："+batteryStatus);
+        TextView distancestatus = dialogView.findViewById(R.id.distance);
+        distancestatus.setText("当前距离为："+distanceStatus);
+        builder.setView(dialogView);
+        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+            @Override
+            public void onClick(DialogInterface dialog, int which) {
+                // 点击确定按钮后的操作
+                dialog.dismiss();
+            }
+        });
+
+        AlertDialog dialog = builder.create();
+        dialog.show();
+    }
+
 //////////////////////////////滑动开关//////////////////////////////
     public static class SlideUnlockView extends View{
 
@@ -653,4 +670,25 @@ public class VideoActivity extends AppCompatActivity {
             return super.onTouchEvent(event);
         }
     }
+
+    private void shutdown(){
+        warning_thread.stopThread();
+        mThreadPool.shutdownNow();
+    }
+
+    @Override
+    public void onBackPressed() {
+        // 返回到 MainActivity
+        shutdown();
+        Intent intent = new Intent(this, MainActivity.class);
+        startActivity(intent);
+        finish(); // 结束 VideoActivity
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        // 关闭线程
+        shutdown();
+    }
 }
\ No newline at end of file
diff --git a/src/sixaunyi/app/src/main/res/drawable-v24/selfhome.png b/src/sixaunyi/app/src/main/res/drawable-v24/selfhome.png
new file mode 100644
index 0000000..db334af
Binary files /dev/null and b/src/sixaunyi/app/src/main/res/drawable-v24/selfhome.png differ
diff --git a/src/sixaunyi/app/src/main/res/layout-land/activity_control.xml b/src/sixaunyi/app/src/main/res/layout-land/activity_control.xml
index e57105c..e51286e 100644
--- a/src/sixaunyi/app/src/main/res/layout-land/activity_control.xml
+++ b/src/sixaunyi/app/src/main/res/layout-land/activity_control.xml
@@ -246,6 +246,17 @@
             android:text="ToggleButton"
             android:textOff=""
             android:textOn="" />
+        <ImageButton
+            android:id="@+id/self_home"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:background="@null"
+            android:layout_marginLeft="20dp"
+            android:src="@drawable/selfhome"
+            android:text="自动返航"
+            android:scaleType="centerCrop"
+            android:contentDescription="@string/show_status_button"
+            />
     </LinearLayout>
 
     <TextView
diff --git a/src/sixaunyi/app/src/main/res/layout/activity_login.xml b/src/sixaunyi/app/src/main/res/layout/activity_login.xml
index a398864..b30c9ba 100644
--- a/src/sixaunyi/app/src/main/res/layout/activity_login.xml
+++ b/src/sixaunyi/app/src/main/res/layout/activity_login.xml
@@ -31,8 +31,9 @@
         android:layout_marginLeft="30dp"
         android:layout_marginRight="30dp"/>
     <CheckBox
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        android:id="@+id/remember_check"
+        android:layout_width="100dp"
+        android:layout_height="100dp"
         android:text="记住密码"
         android:layout_marginLeft="280dp"/>
 
@@ -52,4 +53,4 @@
     </LinearLayout>
 
 
-</LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/src/sixaunyi/app/src/main/res/layout/custom_dialog.xml b/src/sixaunyi/app/src/main/res/layout/custom_dialog.xml
new file mode 100644
index 0000000..7d1743f
--- /dev/null
+++ b/src/sixaunyi/app/src/main/res/layout/custom_dialog.xml
@@ -0,0 +1,40 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/dialogTitle"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:padding="16dp"
+        android:text="当前状态"
+        android:textColor="#000000"
+        android:textSize="28sp" />
+
+    <TextView
+        android:id="@+id/battery"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="当前电量："
+        android:padding="16dp"
+        android:textSize="18dp"
+        android:textColor="#000000" />
+    <TextView
+        android:id="@+id/speed"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:textSize="18dp"
+        android:text="当前速度："
+        android:padding="16dp"
+        android:textColor="#000000" />
+    <TextView
+        android:id="@+id/distance"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="当前距离："
+        android:textSize="18dp"
+        android:padding="16dp"
+        android:textColor="#000000" />
+</LinearLayout>
diff --git a/src/sixaunyi/app/src/main/res/values/strings.xml b/src/sixaunyi/app/src/main/res/values/strings.xml
index 26b2329..38d37e2 100644
--- a/src/sixaunyi/app/src/main/res/values/strings.xml
+++ b/src/sixaunyi/app/src/main/res/values/strings.xml
@@ -19,6 +19,7 @@
     <string name="show_status_button">查看状态</string>
     <string name="landing_button123">降落按钮</string>
     <string name="takeoff_button">降落按钮</string>
+    <string name="self_home_button">自动返航按钮</string>
     <string name="hello_first_fragment">Hello first fragment</string>
     <string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
 </resources>
\ No newline at end of file
