Android MVP Setup
Requirements
- Android Studio Iguana+ / AGP 8.5+
- Android device/emulator with API 26+
- Go toolchain (for gomobile bridge generation)
Build Steps
- Build Go mobile bindings for
pkg/mobilebridge(AAR/JAR) and place them in the Android app dependency path. - Open
android/in Android Studio. - Sync Gradle.
- Build and install
appon a device.
Required Permissions
BIND_VPN_SERVICE(service permission)FOREGROUND_SERVICEINTERNETPOST_NOTIFICATIONS(Android 13+)
Runtime Flow
- Tap Connect.
- Grant VPN permission.
ShadowNetVpnServiceestablishes TUN.AgentServicestarts Go agent loop and renders config.SingBoxControllerstartssing-box run -c <config>.
Assets
- Templates are under
android/app/src/main/assets/templates/. - Place per-arch sing-box binaries at:
- android/app/src/main/assets/sing-box/arm64-v8a/sing-box - android/app/src/main/assets/sing-box/armeabi-v7a/sing-box
Notes
- If sing-box asset is missing, app stays fail-safe and reports an explicit error in logs.
- No cloud dependency is required for runtime operation.