Spaces:
Running on Zero
Running on Zero
HearthNet Android Deployment Guide
Quick Start: PWA (Progressive Web App) - RECOMMENDED โญ
Status: โ Ready to use now - no APK build needed!
Install HearthNet on Android (ANY device, no installation required):
Start the HearthNet server on your computer:
cd c:\Users\Chris4K\Projekte\HearthNet python app.pyFind your computer's IP address:
ipconfig # Look for "IPv4 Address" under your network (e.g., 192.168.1.100)On your Android device, open any browser (Chrome, Firefox, Edge, Samsung Internet):
- Go to:
http://YOUR_COMPUTER_IP:7860 - Example:
http://192.168.1.100:7860
- Go to:
Install as app (browser-specific):
- Chrome/Edge: Menu โ "Install app" or "Add to home screen"
- Firefox: Menu โ "Install"
- Samsung Internet: Menu โ "Add to home screen"
Done! ๐ HearthNet is now on your home screen with:
- Full offline support (Service Worker caching)
- Native app appearance (standalone mode)
- All features available
Alternative: Native APK Build (Advanced)
Why PWA is better:
- โ Works instantly - no build needed
- โ Updates automatically
- โ Works on Chrome, Firefox, Edge, Samsung Internet
- โ Smaller downloads (only web assets)
- โ No app store needed
APK Build Status:
- โ ๏ธ Requires complex local setup: Java 17 JDK, Gradle, Android SDK, cmdline-tools
- โ ๏ธ Build time: 5-15 minutes
- โ ๏ธ APK size: ~80-100 MB
- โ One-time setup, then works offline completely
If you want native APK anyway:
Option A: Android Studio GUI (Recommended)
- Install Android Studio
- File โ Open โ
c:\Users\Chris4K\Projekte\HearthNet\build\android\HearthNetApp - Build โ Build Bundle(s) / APK(s) โ Build APK(s)
- Find APK in:
platforms/android/app/build/outputs/apk/debug/app-debug.apk - Install on device:
adb install -r app-debug.apk
Option B: Docker (Container-based)
- Install Docker Desktop
- Run build container:
cd c:\Users\Chris4K\Projekte\HearthNet\build\android docker build -f Dockerfile.build -t hearthnet-builder . docker run --rm -v $(pwd)\HearthNetApp:/project hearthnet-builder
Option C: Manual CLI Build
- Install Java 17 JDK, Gradle, Android SDK cmdline-tools
- Set
ANDROID_HOMEenvironment variable - Run:
npx cordova build android --release - APK appears in:
platforms/android/app/build/outputs/apk/
Testing Checklist
PWA Testing (5 minutes):
- Server running:
python app.py - Browser opens:
http://YOUR_IP:7860 - Install option appears in menu
- App icon on home screen
- Offline mode works (disable WiFi, app still loads)
- Chat/Ask/Mesh features functional
APK Testing (if building):
- APK file generated (~80 MB)
- Device has USB Debugging enabled
- ADB recognizes device:
adb devices - Install:
adb install -r app-debug.apk - Tap launcher icon to open
- Enter server IP and connect
- Same features work as PWA
Features Available
Both PWA and APK include:
- โ Service Worker offline caching
- โ Local-first P2P mesh network
- โ Chat interface
- โ Ask (LLM) interface
- โ Mesh network topology view
- โ Landing page with server connection
- โ Persistent storage (localStorage)
- โ Background sync placeholder
Troubleshooting
"Cannot connect to server"
- Check computer is on same WiFi as Android device
- Verify server running:
python app.py - Try ping:
ping 192.168.1.100from Android (some WiFis block) - Check firewall isn't blocking port 7860
PWA not installing
- Use Chrome/Edge/Firefox (Samsung Internet also works)
- Tap menu icon (โฎ or three dots)
- Look for "Install" or "Add to Home Screen"
- Not all browsers show this option
APK won't install
- Enable developer mode: Settings โ About Phone โ tap Build# 7 times
- Enable USB Debugging: Settings โ Developer Options โ USB Debugging
- Try:
adb install -r app-debug.apk(includes -r flag to replace)
Build errors
- Run:
npx cordova cleanbefore rebuilding - Remove:
platforms/androidfolder and re-add platform - Check Java:
java -versionreturns 17+ - Check Android SDK:
android list targetsshows API 31+
Architecture
User Browser/App
โ
PWA/APK
โ
Cordova Wrapper (APK only)
โ
FastAPI Backend (http://localhost:7860)
โ
HearthNet Mesh
โ
P2P Network
Next Steps
Try PWA first (5 minutes):
python app.py # Then open http://YOUR_IP:7860 on AndroidIf you need native APK:
- Use Android Studio GUI (easiest)
- Or follow Docker instructions
- Or follow manual CLI instructions
Deploy to Play Store (future):
- Sign APK with keystore
- Create Google Play account
- Upload and publish
Documentation Files
- PWA Implementation - Full web app details
- Cordova Build Guide - Detailed native build
- APK Setup - Project status
- Build Paths - Decision guide
Recommended: Start with PWA - it's production-ready now! ๐