# Mission Bridge: My Plans

This addition preserves your current DJI status, JSON parser and route preview. It does not enable aircraft commands.

1. Copy `MyPlans.java` into `app/src/main/java/ca/terraskies/missionbridge/` next to `MainActivity.java`.
2. In `MainActivity.onCreate`, immediately after the existing `content.addView(choose, ...)` statement, add:

```java
addGap(content, 10);
Button myPlans = new Button(this);
myPlans.setText("My Plans — cloud & offline");
myPlans.setAllCaps(false);
myPlans.setOnClickListener(v -> MyPlans.show(this, uri ->
        onActivityResult(PICK_PLAN, RESULT_OK, new Intent().setData(uri))));
content.addView(myPlans, new LinearLayout.LayoutParams(
        LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
```

3. Keep the existing INTERNET permission and `android:allowBackup="false"` in the manifest. No new DJI settings or Gradle dependencies are needed.
4. Build and install through Android Studio as before.
5. In the computer planner, sign in with ChatGPT, name the plan and select **Save to cloud**. Select **Connect Mission Bridge** and copy the code.
6. On the phone, tap **My Plans**, paste the code once, and select your plan. It opens through your current route preview. The plan is retained under **Downloaded plans (offline)**.

The code grants read-only access and expires after 90 days. Creating a replacement code invalidates the previous one. **Disconnect phone** in the planner revokes cloud access; copies already downloaded to a phone remain until disconnected/removed there. Offline copies represent the last version downloaded, not live updates. Refresh cloud plans to get later computer edits.

The Android SDK and your latest MainActivity are not available in this workspace, so this source addition has not been compiled or device-tested here. Send the latest MainActivity.java if you want a complete merged replacement file rather than the small insertion above.
