Android App

Webview-based application and Android build

Technology

The android module enables Project Forge applications 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.

Overview

This module provides:

Key Features

Native Integration

Build System

Deployment

Architecture

The Android module creates a hybrid application architecture:

Android App Container
├── Native Android Activity
├── WebView Component
│   └── Your Project Forge Web App
├── Go Mobile Library (AAR)
│   └── Core Application Logic
└── Android Resources
    ├── Icons and Assets
    ├── Manifest Configuration
    └── Build Configuration

Package Structure

Build Infrastructure

Templates

Build Process

The Android build process follows these steps:

  1. Go Compilation: Uses gomobile bind to compile Go code to Android AAR
  2. Project Setup: Copies Android template to build directory
  3. Library Integration: Includes compiled AAR in Android project
  4. APK Build: Uses Gradle to build final APK file
  5. Packaging: Creates distribution ZIP files

Requirements

Development Dependencies

Runtime Requirements

Configuration

Android Manifest

The module provides a configurable Android manifest template supporting: - Application name and package configuration - Permission declarations - Target SDK version settings - Icon and theme customization

Build Options

Configure builds through Project Forge settings: - Target Android API level - Application signing configuration - Build variants (debug/release) - Icon and splash screen assets

Usage

Prerequisites

Ensure the android build option is enabled in your Project Forge configuration.

Building Android App

1
2
3
4
5
# Build Android application
./bin/build/android.sh [version]

# Example with version
./bin/build/android.sh 1.0.0

Build Outputs

After 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 Workflow

  1. Development: Develop and test your web application normally
  2. Android Build: Run the Android build script
  3. Testing: Install APK on device or emulator for testing
  4. Iteration: Rebuild after making changes to your web app

Customization

Icons and Branding

Advanced Configuration

Troubleshooting

Common Issues

Build Fails - Missing Dependencies

1
2
3
# Ensure gomobile is installed
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init

APK 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

Source Code