The android module enables your application to be deployed as native Android applications using a webview-based architecture.
It provides a complete Android build pipeline that wraps your web application in a native Android container.
This module provides:
- Native Android App: Complete Android project template with webview integration
- Build Pipeline: Automated build scripts using gomobile and Gradle
- Cross-Platform: Leverages your existing web application without code changes
- Distribution Ready: Generates APK files ready for Google Play Store or sideloading
- Native Android webview container
- Full-screen web application experience
- Native navigation and lifecycle management
- Platform-specific optimizations
- gomobile integration for Go-to-Android compilation
- Gradle build system for Android project management
- Automated AAR (Android Archive) generation
- APK packaging and signing support
- Debug and release build configurations
- ZIP packaging for easy distribution
- Android Studio project generation
- Compatible with Google Play Store requirements
The Android module creates a hybrid application architecture:
Android App Container
├── Native Android Activity
├── WebView Component
│ └── Your App
├── Go Mobile Library (AAR)
│ └── Core Application Logic
└── Android Resources
├── Icons and Assets
├── Manifest Configuration
└── Build Configuration
bin/build/android.sh- Main build script for Android applications- Compiles Go code to Android Archive (AAR) format
- Sets up Android Studio project structure
- Builds APK files for distribution
tools/android/- Complete Android Studio project template- Android manifest configuration
- Gradle build files
- WebView activity implementation
- Resource files and icons
The Android build process follows these steps:
- Go Compilation: Uses
gomobile bindto compile Go code to Android AAR - Project Setup: Copies Android template to build directory
- Library Integration: Includes compiled AAR in Android project
- APK Build: Uses Gradle to build final APK file
- Packaging: Creates distribution ZIP files
- Go 1.26+ with gomobile support
- Android SDK with API level 21+
- Gradle build system
- Java Development Kit (JDK) 8+
- Android 5.0 (API level 21) or higher
- WebView component (standard on all Android devices)
- Network connectivity (for web application features)
The module provides a configurable Android manifest template supporting:
- Application name and package configuration
- Permission declarations
- Target SDK version settings
- Icon and theme customization
Configure builds through your application's configuration:
- Target Android API level
- Application signing configuration
- Build variants (debug/release)
- Icon and splash screen assets
Ensure the android build option is enabled in your application's configuration.
# Build Android application
./bin/build/android.sh [version]
# Example with version
./bin/build/android.sh 1.0.0After successful build, find outputs in:
./build/dist/mobile_android_arm64/- Android Studio project./build/dist/{app_name}_android_aar.zip- Go mobile library./build/dist/{app_name}_android_apk.zip- Installable APK files
- Development: Develop and test your web application normally
- Android Build: Run the Android build script
- Testing: Install APK on device or emulator for testing
- Iteration: Rebuild after making changes to your web app
- Replace icon files in the Android template
- Modify application name in manifest
- Configure splash screen and themes
- Set package name and version information
- Modify Gradle build scripts for custom dependencies
- Adjust WebView settings for performance
- Configure native Android features (permissions, services)
- Customize build variants and signing configurations
Build Fails - Missing Dependencies
# Ensure gomobile is installed
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile initAPK Install Fails
- Check Android device/emulator API level (minimum API 21)
- Verify developer options and USB debugging enabled
- Ensure sufficient storage space
WebView Not Loading
- Review Android log output for errors
- Repository: https://github.com/kyleu/projectforge/tree/main/module/android
- License: CC0 (Public Domain)
- Author: Kyle U (kyle@kyleu.com)
- Android Documentation - Official Android developer documentation
- Project Forge Documentation - Complete documentation