# CloudVault 2.0 – Android Setup & Installation Guide

CloudVault Android application is built with Flutter, targeting Android 10+ (API level 29–35).

---

## 📱 Prerequisites
- Android SDK Platform 34 / 35
- Java Development Kit (JDK 17)
- Flutter SDK 3.13+ or 3.29+
- Android device or emulator running Android 8.0+

---

## 🔨 Building the Android APK

1. Verify environment:
```bash
flutter doctor
```

2. Fetch Flutter packages:
```bash
flutter pub get
```

3. Run static analyzer and test suite:
```bash
flutter analyze lib
flutter test
```

4. Build the test APK:
```bash
flutter build apk --debug
```
The generated APK is located at:
`build/app/outputs/flutter-apk/app-debug.apk`

---

## 📲 Installing on a Physical Android Phone

1. Enable **Developer Options** and **USB Debugging** on your phone.
2. Connect your phone via USB or copy the APK to your phone storage:
```bash
adb install -r release/CloudVault-2.0-Test.apk
```
Or transfer `release/CloudVault-2.0-Test.apk` via Google Drive, WhatsApp, or USB file transfer and install directly on the phone.

---

## 🌐 Network Configuration for Multi-Device Sync

1. When testing on physical Android devices connected to the same Wi-Fi network:
   - Ensure the central backend is running: `python backend/app.py`.
   - The app auto-detects `http://192.168.0.125:5000`.
   - If your host PC has a different LAN IP, tap **Server Settings** on the Login/Register screen and enter your PC's IP (e.g. `http://192.168.1.50:5000`).
2. When testing on 4G/5G mobile data:
   - CloudVault features **Resilient Multi-Device Provisioning**: registration and login work instantly on the phone without timing out or blocking!
   - To sync in real time over cellular 5G, you can expose the backend via an ngrok or Cloudflare tunnel and paste the public HTTPS URL in Server Settings.
