The Android app wraps the same statically exported Next.js frontend in a Tauri v2 Android WebView. The Android-specific generated files live inDocumentation Index
Fetch the complete documentation index at: https://docs.laportenard.com/llms.txt
Use this file to discover all available pages before exploring further.
nu_pos_react/src-tauri/gen/android/.
Commands
Run fromnu_pos_react/:
Prerequisites
Android SDK
Install Android Studio or the standalone SDK. Set
ANDROID_HOME and ensure platform-tools and build-tools are installed.NDK
Install the Android NDK via Android Studio SDK Manager. Required for compiling the Rust native library.
Content Security Policy
The CSP is defined insrc-tauri/tauri.conf.json under app.security.csp. Android WebView enforces CSP more strictly than desktop platforms.
Why bare wildcard is needed
The hub runs on the local network at a plain IP address (e.g.ws://10.0.20.63:8766). Per the CSP spec, http://* covers HTTP hosts but not WebSocket schemes. Adding ws://* and wss://* should work in theory, but Android WebView’s CSP implementation fails to match them against raw IP addresses. The bare * wildcard matches all schemes and hosts.
Cleartext traffic
Android 9+ blocks cleartext (non-TLS) network traffic by default. Since the hub usesws:// on the local network, cleartext must be explicitly allowed.
Two files control this:
- build.gradle.kts
- Network security config
In By default, Tauri only sets this to
src-tauri/gen/android/app/build.gradle.kts, the usesCleartextTraffic manifest placeholder must be "true" for both debug and release:"true" for debug builds. If your hub runs on ws:// (not wss://), you must change the default as well.Debugging
Chrome DevTools (recommended)
Inspect the Android WebView remotely using Chrome on your development machine.Enable devtools in Cargo.toml
Add the Without this, Chrome cannot see the WebView in release builds. Debug builds enable it automatically.
devtools feature to the Tauri dependency in src-tauri/Cargo.toml:Open Chrome inspector
Navigate to
chrome://inspect/#devices in Chrome on your Mac. The app’s WebView should appear in the remote devices list.The
devtools Cargo feature increases the binary size slightly. You can remove it for production distribution once debugging is complete.ADB logcat (fallback)
If Chrome DevTools is not available, use ADB to tail logs:Key differences from desktop
| Aspect | Desktop | Android |
|---|---|---|
| CSP enforcement | Lenient (Chromium desktop) | Strict (Android WebView) |
| Cleartext traffic | Allowed by default | Blocked by default on Android 9+ |
| WebView debugging | Always available | Requires devtools Cargo feature for release builds |
| Window management | tauri-plugin-window-state | Not applicable (excluded via cfg(not(target_os = "android"))) |
| Screen orientation | User-controlled | Locked to landscape via AndroidManifest.xml |