mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
This commit adds comprehensive Android support for Wails v3, enabling Go applications to run as native Android apps with WebView-based UI. Key features: - Android-specific application implementation with JNI bridge - WebView integration via WebViewAssetLoader for serving assets - JavaScript runtime injection and execution via JNI callbacks - Binding call support with async result callbacks - Event system support for Android platform - Full example Android app with Gradle build system Technical details: - Uses CGO with Android NDK for cross-compilation - Implements JNI callbacks for Go <-> Java communication - Supports both ARM64 and x86_64 architectures - WebView debugging support via Chrome DevTools Protocol - Handles empty response body case in binding calls to prevent panic Files added: - v3/pkg/application/*_android.go - Android platform implementations - v3/pkg/events/events_android.go - Android event definitions - v3/internal/*/\*_android.go - Android-specific internal packages - v3/examples/android/ - Complete example Android application - v3/ANDROID_ARCHITECTURE.md - Architecture documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
32 lines
605 B
Go
32 lines
605 B
Go
//go:build android
|
|
|
|
package application
|
|
|
|
// getScreens returns the available screens for Android
|
|
func getScreens() ([]*Screen, error) {
|
|
// Android typically has one main display
|
|
// TODO: Support for multi-display via DisplayManager
|
|
return []*Screen{
|
|
{
|
|
ID: "main",
|
|
Name: "Main Display",
|
|
IsPrimary: true,
|
|
Size: Size{
|
|
Width: 1080,
|
|
Height: 2400,
|
|
},
|
|
Bounds: Rect{
|
|
X: 0,
|
|
Y: 0,
|
|
Width: 1080,
|
|
Height: 2400,
|
|
},
|
|
WorkArea: Rect{
|
|
X: 0,
|
|
Y: 0,
|
|
Width: 1080,
|
|
Height: 2340, // Minus navigation bar
|
|
},
|
|
},
|
|
}, nil
|
|
}
|