mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-16 23:55:52 +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>
42 lines
846 B
Go
42 lines
846 B
Go
//go:build linux && !android
|
|
|
|
package operatingsystem
|
|
|
|
/*
|
|
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.1
|
|
#include <webkit2/webkit2.h>
|
|
*/
|
|
import "C"
|
|
import "fmt"
|
|
|
|
type WebkitVersion struct {
|
|
Major uint
|
|
Minor uint
|
|
Micro uint
|
|
}
|
|
|
|
func GetWebkitVersion() WebkitVersion {
|
|
var major, minor, micro C.uint
|
|
major = C.webkit_get_major_version()
|
|
minor = C.webkit_get_minor_version()
|
|
micro = C.webkit_get_micro_version()
|
|
return WebkitVersion{
|
|
Major: uint(major),
|
|
Minor: uint(minor),
|
|
Micro: uint(micro),
|
|
}
|
|
}
|
|
|
|
func (v WebkitVersion) String() string {
|
|
return fmt.Sprintf("v%d.%d.%d", v.Major, v.Minor, v.Micro)
|
|
}
|
|
|
|
func (v WebkitVersion) IsAtLeast(major int, minor int, micro int) bool {
|
|
if v.Major != uint(major) {
|
|
return v.Major > uint(major)
|
|
}
|
|
if v.Minor != uint(minor) {
|
|
return v.Minor > uint(minor)
|
|
}
|
|
return v.Micro >= uint(micro)
|
|
}
|