This adds a Capacitor wrapper around the static web app in src/web so you can
run it on your phone.
- Node.js 18+
- Android Studio + SDKs (for Android build)
- Java 17 (recommended via Android Studio install)
npm install
npx cap add android
If you see a message about TypeScript, it's already installed, since we use
capacitor.config.ts.
- (Optional) Start the API locally if you want to test your own backend:
npm run dev:api
- Find your PC's LAN IP address, e.g.
192.168.1.10. - In a new terminal, set the server URL for Capacitor and sync:
PowerShell (Windows):
$env:CAP_SERVER_URL = "http://192.168.1.10:8302"; npx cap sync android
- Open Android Studio and run on your device:
npx cap open android
This will load the app from your PC's server. Your phone must be on the same Wi‑Fi network. Geolocation prompts will work on device.
If you prefer bundling the static files instead of using the dev server:
$env:CAP_SERVER_URL = ""; npx cap sync android
This uses the built files from src/web.
- The web app and widget now call
https://weather.oreostack.uk/apidirectly. To point at your own backend, change the URL insrc/web/script/main.jsandandroid/app/src/main/java/com/empowering/weather/WeatherWidgetProvider.java. - To change the app name or id, edit
capacitor.config.ts.