[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KRBX67YAG3B2KMZKVS4EYT":3,"skill-same:01M6KRBX67YAG3B2KMZKVS4EYT":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6KRBX67YAG3B2KMZKVS4EYT","mobile-development",null,"Use when targeting Android\u002FiOS — export and signing, permissions, plugins, in-app purchases, ads, app lifecycle, device features, and mobile performance","jame581\u002FGodotPrompter","jame581","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21112138?v=4","01M6KR3KEQ9Z30WVJRR2E2ZVXE","Jan Mesarč","01M6KR3KJVRMPDSMASQPBCBVK3",964,"MIT","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fmobile-development\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"mobile development","mobile","development","when","device","mobile performance","export","plugins","features","ios","ads","signing","android","permissions","use","targeting","lifecycle","performance","app","2026-11-10 10:12:30",false,"---\nname: mobile-development\ndescription: Use when targeting Android\u002FiOS — export and signing, permissions, plugins, in-app purchases, ads, app lifecycle, device features, and mobile performance\n---\n\n# Mobile Development\n\nShip a Godot 4.x game to Android and iOS. This covers the platform-specific deltas beyond a generic export: signing, lifecycle, permissions, plugins, IAP, device features, and the mobile renderer\u002Fperf budget.\n\n> **Related skills:** **export-pipeline** for the generic export flow and CI\u002FCD, **responsive-ui** for safe-area layout, **input-handling** for touch, **godot-optimization** for mobile performance, **csharp-godot** for C# mobile caveats.\n\n---\n\n## 1. Export & signing\n\n**Android:** OpenJDK 17 and the Android SDK; set `Java SDK Path` + `Android SDK Path` in **Editor Settings** (per-user, not per-project). Generate a release keystore:\n\n```bash\nkeytool -v -genkey -keystore mygame.keystore -alias mygame -keyalg RSA -validity 10000\n```\n\nPreset fields: **Release \u002F Release User \u002F Release Password** (keystore and key passwords must currently match); uncheck **Export With Debug**. **AAB is mandatory for new Play uploads.** CI env overrides: `GODOT_ANDROID_KEYSTORE_RELEASE_{PATH,USER,PASSWORD}`.\n\n**iOS:** macOS + Xcode. Export needs an **App Store Team ID** + a reverse-DNS bundle **Identifier**; Godot generates an `.xcodeproj` you build from Xcode. Test on the iOS **simulator with the Compatibility renderer** — Forward+\u002FMobile support there depends on the simulator's Metal.\n\nA **custom Gradle build** (*Project → Install Android Build Template...*; 4.8: *Project → Setup Android Build...*) is **required for v2 plugins and IAP** (Godot 4.2+). Since Godot 4.7 the **Use Gradle Build** export option is no longer marked experimental ([GH-119172](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F119172)) — treat it as the standard path when you need plugins or IAP.\n\n> ⚠️ **Changed in Godot 4.7:** Deprecated Google Play OBB expansion-file support (the `apk_expansion\u002F*` export options) was removed from the Android export. Projects still relying on APK expansion files should move to Android App Bundles with Play Asset Delivery, or install the separate [Godot OBB plugin](https:\u002F\u002Fgithub.com\u002Fm4gr3d\u002Fgodot-obb-plugin) that now holds the old logic. See [GH-118283](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F118283).\n\n---\n\n## 2. App lifecycle\n\nReal `Node` notification constants: `NOTIFICATION_APPLICATION_PAUSED` (2015), `NOTIFICATION_APPLICATION_RESUMED` (2014), `NOTIFICATION_APPLICATION_FOCUS_IN`\u002F`_OUT` (2016\u002F2017), `NOTIFICATION_WM_GO_BACK_REQUEST` (1007, Android Back). **There is no `WM_CLOSE_REQUEST` on mobile.** Autosave on PAUSED; **iOS gives ~5 s** after pause to finish work before it kills the app.\n\n### GDScript\n\n```gdscript\nfunc _notification(what: int) -> void:\n    match what:\n        NOTIFICATION_APPLICATION_PAUSED:\n            SaveManager.save_game() # App backgrounded — persist now.\n        NOTIFICATION_WM_GO_BACK_REQUEST:\n            _confirm_quit()         # Android Back button.\n```\n\n### C# Equivalent\n\nThe docs only show `NotificationWMCloseRequest` verbatim; these PascalCase names follow the same convention.\n\n```csharp\npublic override void _Notification(int what)\n{\n    switch ((long)what)\n    {\n        case NotificationApplicationPaused:\n            SaveManager.SaveGame(); \u002F\u002F App backgrounded — persist now.\n            break;\n        case NotificationWMGoBackRequest:\n            ConfirmQuit();          \u002F\u002F Android Back button.\n            break;\n    }\n}\n```\n\n### Picture-in-Picture (Android, Godot 4.7+)\n\n`DisplayServer.pip_mode_enter(window_id = 0)` enters picture-in-picture mode; `is_in_pip_mode(window_id = 0)` reports the current state; `pip_mode_set_aspect_ratio(numerator, denominator, window_id = 0)` sets the PiP window's aspect ratio; `pip_mode_set_auto_enter_on_background(auto_enter_on_background, window_id = 0)` enters PiP automatically when the app goes to the background. Transitions arrive as `Node` notifications: `NOTIFICATION_APPLICATION_PIP_MODE_ENTERED` (2019) \u002F `NOTIFICATION_APPLICATION_PIP_MODE_EXITED` (2020). All Android-only.\n\n```gdscript\nfunc _ready() -> void:\n    DisplayServer.pip_mode_set_aspect_ratio(16, 9)\n    DisplayServer.pip_mode_set_auto_enter_on_background(true)\n\nfunc _notification(what: int) -> void:\n    match what:\n        NOTIFICATION_APPLICATION_PIP_MODE_ENTERED:\n            _set_minimal_hud(true)  # PiP window is tiny — hide non-essential UI.\n        NOTIFICATION_APPLICATION_PIP_MODE_EXITED:\n            _set_minimal_hud(false)\n```\n\n```csharp\npublic override void _Ready()\n{\n    DisplayServer.PipModeSetAspectRatio(16, 9);\n    DisplayServer.PipModeSetAutoEnterOnBackground(true);\n}\n\npublic override void _Notification(int what)\n{\n    switch ((long)what)\n    {\n        case NotificationApplicationPipModeEntered:\n            SetMinimalHud(true);  \u002F\u002F PiP window is tiny — hide non-essential UI.\n            break;\n        case NotificationApplicationPipModeExited:\n            SetMinimalHud(false);\n            break;\n    }\n}\n```\n\n---\n\n## 3. Permissions\n\nDeclare each permission in the export preset as `permissions\u002F\u003Cname>`; request it at runtime with `OS.request_permission(name)`. The result arrives via `MainLoop`'s `on_request_permissions_result(permission, granted)`. The permission **must also be enabled in the preset**, not just requested.\n\n### GDScript\n\n```gdscript\nfunc _ready():\n    if \"android.permission.POST_NOTIFICATIONS\" not in OS.get_granted_permissions():\n        OS.request_permission(\"android.permission.POST_NOTIFICATIONS\")\n    get_tree().on_request_permissions_result.connect(_on_perm_result)\n\nfunc _on_perm_result(permission: String, granted: bool):\n    print(\"%s granted: %s\" % [permission, granted])\n```\n\n### C# Equivalent\n\n```csharp\n\u002F\u002F Contains() on string[] needs: using System.Linq;\npublic override void _Ready()\n{\n    if (!OS.GetGrantedPermissions().Contains(\"android.permission.POST_NOTIFICATIONS\"))\n        OS.RequestPermission(\"android.permission.POST_NOTIFICATIONS\");\n    GetTree().OnRequestPermissionsResult += OnPermResult;\n}\n\nprivate void OnPermResult(string permission, bool granted)\n    => GD.Print($\"{permission} granted: {granted}\");\n```\n\n---\n\n## 4. Calling Android APIs (JavaClassWrapper) — Godot 4.4+\n\n**Godot 4.4+.** `JavaClassWrapper.wrap(\"\u003Cjava.class>\")` (present earlier, but only practical from 4.4) calls Java\u002FKotlin classes with no plugin; the `AndroidRuntime` singleton, new in 4.4, (`Engine.get_singleton(\"AndroidRuntime\")`) exposes `getActivity()`, `getApplicationContext()`, and `createRunnableFromGodotCallable(callable)`.\n\nThe simpler cross-platform alternative needs no 4.4: `Input.vibrate_handheld(duration_ms, amplitude)` (requires the `VIBRATE` permission; iOS needs iOS 13+). See [Plugins](references\u002Fplugins.md) for the full JavaClassWrapper\u002FAndroidRuntime API, Toast\u002FIntent recipes, and inner-class syntax.\n\n### GDScript\n\n```gdscript\n# Godot 4.4+ — requires the VIBRATE permission in the export preset.\nfunc vibrate_ms(duration_ms: int) -> void:\n    if Engine.has_singleton(\"AndroidRuntime\"):\n        var runtime := Engine.get_singleton(\"AndroidRuntime\")\n        var context := runtime.getApplicationContext()\n        var vibrator := context.getSystemService(\"vibrator\")\n        if vibrator.hasVibrator():\n            var Effect = JavaClassWrapper.wrap(\"android.os.VibrationEffect\")\n            var effect = Effect.createOneShot(duration_ms, Effect.DEFAULT_AMPLITUDE)\n            vibrator.vibrate(effect)\n```\n\n### C# Equivalent\n\nThe docs are GDScript-only here; the exact C# Variant-marshaling chain (`.AsGodotObject()` on each Java return) is untested against a device — verify on a real 4.4+ Android build.\n\n```csharp\n\u002F\u002F Godot 4.4+ — requires the VIBRATE permission in the export preset.\npublic void VibrateMs(int durationMs)\n{\n    if (!Engine.HasSingleton(\"AndroidRuntime\")) return;\n    var runtime = Engine.GetSingleton(\"AndroidRuntime\");\n    var context = runtime.Call(\"getApplicationContext\").AsGodotObject();\n    var vibrator = context.Call(\"getSystemService\", \"vibrator\").AsGodotObject();\n    if (vibrator.Call(\"hasVibrator\").AsBool())\n    {\n        var effect = JavaClassWrapper.Wrap(\"android.os.VibrationEffect\");\n        var oneShot = effect.Call(\"createOneShot\", durationMs, effect.Get(\"DEFAULT_AMPLITUDE\"));\n        vibrator.Call(\"vibrate\", oneShot);\n    }\n}\n```\n\n### Implementing Java Interfaces from Script (Godot 4.7+)\n\n`JavaClassWrapper.create_proxy(object: Object, interfaces: PackedStringArray) -> JavaObject` implements the given Java interfaces using a Godot object — the object's method signatures must match the Java interfaces' method signatures, and Java calls route to the matching method. `create_sam_callback(sam_interface: String, callable: Callable) -> JavaObject` covers single-abstract-method (SAM) interfaces with a `Callable` matching the SAM method's parameters and return type. Both return `null` on every platform except Android.\n\n```gdscript\nclass PrintProxy:\n    func println(content: String) -> void:\n        print(content)\n\nfunc _demo() -> void:\n    var print_proxy := PrintProxy.new()\n    var printer := JavaClassWrapper.create_proxy(print_proxy, [\"android.util.Printer\"])\n    printer.println(\"Hello Godot World!\")\n\n    var cb := func(content: String) -> void: print(content)\n    var callback := JavaClassWrapper.create_sam_callback(\"android.util.Printer\", cb)\n    callback.println(\"Hello Godot World!\")\n```\n\nThe docs are GDScript-only here. `CreateProxy` matches methods by their registered name, so a C# implementation class would need method names matching the Java interface exactly — prefer `CreateSamCallback` from C#:\n\n```csharp\nvar cb = Callable.From((string content) => GD.Print(content));\nvar callback = JavaClassWrapper.CreateSamCallback(\"android.util.Printer\", cb);\ncallback.Call(\"println\", \"Hello Godot World!\");\n```\n\n---\n\n## 5. Device features & safe area\n\n`DisplayServer.get_display_safe_area() -> Rect2i` (Android\u002FiOS) returns the usable region inside notches\u002Fcutouts; `get_display_cutouts()` (Android) lists the cutout rects. Motion sensors live on `Input` (`get_accelerometer\u002Fgravity\u002Fgyroscope\u002Fmagnetometer`, returning `Vector3`, Android\u002FiOS only).\n\n### GDScript\n\n```gdscript\nfunc _ready():\n    var safe := DisplayServer.get_display_safe_area() # Rect2i\n    $UI.position = safe.position\n    $UI.size = safe.size\n```\n\n### C# Equivalent\n\n```csharp\npublic override void _Ready()\n{\n    Rect2I safe = DisplayServer.GetDisplaySafeArea();\n    var ui = GetNode\u003CControl>(\"UI\");\n    ui.Position = safe.Position;\n    ui.Size = safe.Size;\n}\n```\n\nNative file dialogs (`DisplayServer.file_dialog_show()`) are supported on Android; since Godot 4.7 the native file picker works on all devices — the Android version check gating `FEATURE_NATIVE_DIALOG_FILE` support was removed ([GH-115257](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F115257)).\n\n> **Godot 4.7+:** For on-screen touch joysticks, use the built-in `VirtualJoystick` Control node instead of a hand-rolled `TouchScreenButton` rig — see **input-handling** (`references\u002Ftouch.md`, \"VirtualJoystick (Godot 4.7+)\") for the full API.\n\n### Device Orientation Signal (Godot 4.7+)\n\n`DisplayServer.orientation_changed(orientation: int)` (Android\u002FiOS) fires when the device orientation changes: `1` portrait, `2` landscape, `0` undefined.\n\n```gdscript\nfunc _ready() -> void:\n    DisplayServer.orientation_changed.connect(_on_orientation_changed)\n\nfunc _on_orientation_changed(orientation: int) -> void:\n    _relayout_hud(orientation == 2)  # 1 portrait, 2 landscape, 0 undefined.\n```\n\n```csharp\npublic override void _Ready()\n{\n    DisplayServer.Singleton.Connect(DisplayServer.SignalName.OrientationChanged,\n        Callable.From((long orientation) => RelayoutHud(orientation == 2)));\n}\n```\n\n> **Changed in Godot 4.8:** The `orientation` parameter is now typed as the new `DisplayServer.SensorOrientation` enum (`SENSOR_ORIENTATION_UNDEFINED` 0, `_PORTRAIT` 1, `_LANDSCAPE` 2) and the docs say *screen* orientation. The values are unchanged, so the handlers above keep working. Code that uses the generated C# `OrientationChanged` event may need updating, since its delegate type changes (per the draft 4.8 migration guide; unconfirmed).\n\n---\n\n## 6. Mobile performance & renderer\n\nUse the **Mobile** (or **Compatibility**) renderer; prefer Compatibility on the iOS simulator. Enable `rendering\u002Ftextures\u002Fvram_compression\u002Fimport_etc2_astc = true` (ETC2\u002FASTC) for Android texture compression. Keep single-arch APKs small; AABs split per-device automatically. Defer deep draw-call\u002Fbatching tuning to **godot-optimization**.\n\n---\n\n## 7. C# on mobile\n\nC# Android\u002FiOS export is **Godot 4.2+ but experimental**. **Android C# export requires .NET 9+** (with Godot 4.5); iOS export only from macOS (the export also builds arm64 + x86_64 simulator assemblies). **C# cannot export to Web.** Test the C# export pipeline early — it is the riskiest part of a C# mobile project.\n\n> **Changed in Godot 4.8:** Every C# project, not only Android, needs **.NET 10** (`net10.0`); 4.8 writes `net10.0` for Android too. The \".NET 9+\" above applies to Godot 4.5 to 4.7.\n\n> **Deeper:** [Plugins (Android v2 \u002F iOS)](references\u002Fplugins.md) · [In-app purchases & ads](references\u002Fiap-and-ads.md) · [Crash debugging](references\u002Fcrash-debugging.md)\n\n---\n\n## Implementation Checklist\n\n- [ ] Release keystore (Android) \u002F provisioning + Team ID (iOS) configured\n- [ ] AAB for Play uploads; Gradle build installed if using v2 plugins or IAP\n- [ ] Autosave wired to `NOTIFICATION_APPLICATION_PAUSED` (iOS ~5 s budget respected)\n- [ ] Required permissions enabled in the preset AND requested at runtime\n- [ ] JavaClassWrapper usage labeled Godot 4.4+; fallbacks for 4.3 if needed\n- [ ] UI anchored inside `get_display_safe_area()`; notch\u002Fcutout handled\n- [ ] Mobile\u002FCompatibility renderer + ETC2\u002FASTC compression enabled\n- [ ] C# projects: verified .NET 9+ for Android export (Godot 4.8: .NET 10)\n- [ ] Play OBB\u002FAPK expansion files moved to App Bundles with Play Asset Delivery, or the Godot OBB plugin installed (built-in support removed in Godot 4.7)\n- [ ] PiP (Android): aspect ratio + auto-enter configured; HUD reacts to the PIP_MODE notifications (Godot 4.7+)\n","# Mobile Development\n\nShip a Godot 4.x game to Android and iOS. This covers the platform-specific deltas beyond a generic export: signing, lifecycle, permissions, plugins, IAP, device features, and the mobile renderer\u002Fperf budget.\n\n> **Related skills:** **export-pipeline** for the generic export flow and CI\u002FCD, **responsive-ui** for safe-area layout, **input-handling** for touch, **godot-optimization** for mobile performance, **csharp-godot** for C# mobile caveats.\n\n---\n\n## 1. Export & signing\n\n**Android:** OpenJDK 17 and the Android SDK; set `Java SDK Path` + `Android SDK Path` in **Editor Settings** (per-user, not per-project). Generate a release keystore:\n\n```bash\nkeytool -v -genkey -keystore mygame.keystore -alias mygame -keyalg RSA -validity 10000\n```\n\nPreset fields: **Release \u002F Release User \u002F Release Password** (keystore and key passwords must currently match); uncheck **Export With Debug**. **AAB is mandatory for new Play uploads.** CI env overrides: `GODOT_ANDROID_KEYSTORE_RELEASE_{PATH,USER,PASSWORD}`.\n\n**iOS:** macOS + Xcode. Export needs an **App Store Team ID** + a reverse-DNS bundle **Identifier**; Godot generates an `.xcodeproj` you build from Xcode. Test on the iOS **simulator with the Compatibility renderer** — Forward+\u002FMobile support there depends on the simulator's Metal.\n\nA **custom Gradle build** (*Project → Install Android Build Template...*; 4.8: *Project → Setup Android Build...*) is **required for v2 plugins and IAP** (Godot 4.2+). Since Godot 4.7 the **Use Gradle Build** export option is no longer marked experimental ([GH-119172](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F119172)) — treat it as the standard path when you need plugins or IAP.\n\n> ⚠️ **Changed in Godot 4.7:** Deprecated Google Play OBB expansion-file support (the `apk_expansion\u002F*` export options) was removed from the Android export. Projects still relying on APK expansion files should move to Android App Bundles with Play Asset Delivery, or install the separate [Godot OBB plugin](https:\u002F\u002Fgithub.com\u002Fm4gr3d\u002Fgodot-obb-plugin) that now holds the old logic. See [GH-118283](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F118283).\n\n---\n\n## 2. App lifecycle\n\nReal `Node` notification constants: `NOTIFICATION_APPLICATION_PAUSED` (2015), `NOTIFICATION_APPLICATION_RESUMED` (2014), `NOTIFICATION_APPLICATION_FOCUS_IN`\u002F`_OUT` (2016\u002F2017), `NOTIFICATION_WM_GO_BACK_REQUEST` (1007, Android Back). **There is no `WM_CLOSE_REQUEST` on mobile.** Autosave on PAUSED; **iOS gives ~5 s** after pause to finish work before it kills the app.\n\n### GDScript\n\n```gdscript\nfunc _notification(what: int) -> void:\n    match what:\n        NOTIFICATION_APPLICATION_PAUSED:\n            SaveManager.save_game() # App backgrounded — persist now.\n        NOTIFICATION_WM_GO_BACK_REQUEST:\n            _confirm_quit()         # Android Back button.\n```\n\n### C# Equivalent\n\nThe docs only show `NotificationWMCloseRequest` verbatim; these PascalCase names follow the same convention.\n\n```csharp\npublic override void _Notification(int what)\n{\n    switch ((long)what)\n    {\n        case NotificationApplicationPaused:\n            SaveManager.SaveGame(); \u002F\u002F App backgrounded — persist now.\n            break;\n        case NotificationWMGoBackRequest:\n            ConfirmQuit();          \u002F\u002F Android Back button.\n            break;\n    }\n}\n```\n\n### Picture-in-Picture (Android, Godot 4.7+)\n\n`DisplayServer.pip_mode_enter(window_id = 0)` enters picture-in-picture mode; `is_in_pip_mode(window_id = 0)` reports the current state; `pip_mode_set_aspect_ratio(numerator, denominator, window_id = 0)` sets the PiP window's aspect ratio; `pip_mode_set_auto_enter_on_background(auto_enter_on_background, window_id = 0)` enters PiP automatically when the app goes to the background. Transitions arrive as `Node` notifications: `NOTIFICATION_APPLICATION_PIP_MODE_ENTERED` (2019) \u002F `NOTIFICATION_APPLICATION_PIP_MODE_EXITED` (2020). All Android-only.\n\n```gdscript\nfunc _ready() -> void:\n    DisplayServer.pip_mode_set_aspect_ratio(16, 9)\n    DisplayServer.pip_mode_set_auto_enter_on_background(true)\n\nfunc _notification(what: int) -> void:\n    match what:\n        NOTIFICATION_APPLICATION_PIP_MODE_ENTERED:\n            _set_minimal_hud(true)  # PiP window is tiny — hide non-essential UI.\n        NOTIFICATION_APPLICATION_PIP_MODE_EXITED:\n            _set_minimal_hud(false)\n```\n\n```csharp\npublic override void _Ready()\n{\n    DisplayServer.PipModeSetAspectRatio(16, 9);\n    DisplayServer.PipModeSetAutoEnterOnBackground(true);\n}\n\npublic override void _Notification(int what)\n{\n    switch ((long)what)\n    {\n        case NotificationApplicationPipModeEntered:\n            SetMinimalHud(true);  \u002F\u002F PiP window is tiny — hide non-essential UI.\n            break;\n        case NotificationApplicationPipModeExited:\n            SetMinimalHud(false);\n            break;\n    }\n}\n```\n\n---\n\n## 3. Permissions\n\nDeclare each permission in the export preset as `permissions\u002F\u003Cname>`; request it at runtime with `OS.request_permission(name)`. The result arrives via `MainLoop`'s `on_request_permissions_result(permission, granted)`. The permission **must also be enabled in the preset**, not just requested.\n\n### GDScript\n\n```gdscript\nfunc _ready():\n    if \"android.permission.POST_NOTIFICATIONS\" not in OS.get_granted_permissions():\n        OS.request_permission(\"android.permission.POST_NOTIFICATIONS\")\n    get_tree().on_request_permissions_result.connect(_on_perm_result)\n\nfunc _on_perm_result(permission: String, granted: bool):\n    print(\"%s granted: %s\" % [permission, granted])\n```\n\n### C# Equivalent\n\n```csharp\n\u002F\u002F Contains() on string[] needs: using System.Linq;\npublic override void _Ready()\n{\n    if (!OS.GetGrantedPermissions().Contains(\"android.permission.POST_NOTIFICATIONS\"))\n        OS.RequestPermission(\"android.permission.POST_NOTIFICATIONS\");\n    GetTree().OnRequestPermissionsResult += OnPermResult;\n}\n\nprivate void OnPermResult(string permission, bool granted)\n    => GD.Print($\"{permission} granted: {granted}\");\n```\n\n---\n\n## 4. Calling Android APIs (JavaClassWrapper) — Godot 4.4+\n\n**Godot 4.4+.** `JavaClassWrapper.wrap(\"\u003Cjava.class>\")` (present earlier, but only practical from 4.4) calls Java\u002FKotlin classes with no plugin; the `AndroidRuntime` singleton, new in 4.4, (`Engine.get_singleton(\"AndroidRuntime\")`) exposes `getActivity()`, `getApplicationContext()`, and `createRunnableFromGodotCallable(callable)`.\n\nThe simpler cross-platform alternative needs no 4.4: `Input.vibrate_handheld(duration_ms, amplitude)` (requires the `VIBRATE` permission; iOS needs iOS 13+). See [Plugins](references\u002Fplugins.md) for the full JavaClassWrapper\u002FAndroidRuntime API, Toast\u002FIntent recipes, and inner-class syntax.\n\n### GDScript\n\n```gdscript\n# Godot 4.4+ — requires the VIBRATE permission in the export preset.\nfunc vibrate_ms(duration_ms: int) -> void:\n    if Engine.has_singleton(\"AndroidRuntime\"):\n        var runtime := Engine.get_singleton(\"AndroidRuntime\")\n        var context := runtime.getApplicationContext()\n        var vibrator := context.getSystemService(\"vibrator\")\n        if vibrator.hasVibrator():\n            var Effect = JavaClassWrapper.wrap(\"android.os.VibrationEffect\")\n            var effect = Effect.createOneShot(duration_ms, Effect.DEFAULT_AMPLITUDE)\n            vibrator.vibrate(effect)\n```\n\n### C# Equivalent\n\nThe docs are GDScript-only here; the exact C# Variant-marshaling chain (`.AsGodotObject()` on each Java return) is untested against a device — verify on a real 4.4+ Android build.\n\n```csharp\n\u002F\u002F Godot 4.4+ — requires the VIBRATE permission in the export preset.\npublic void VibrateMs(int durationMs)\n{\n    if (!Engine.HasSingleton(\"AndroidRuntime\")) return;\n    var runtime = Engine.GetSingleton(\"AndroidRuntime\");\n    var context = runtime.Call(\"getApplicationContext\").AsGodotObject();\n    var vibrator = context.Call(\"getSystemService\", \"vibrator\").AsGodotObject();\n    if (vibrator.Call(\"hasVibrator\").AsBool())\n    {\n        var effect = JavaClassWrapper.Wrap(\"android.os.VibrationEffect\");\n        var oneShot = effect.Call(\"createOneShot\", durationMs, effect.Get(\"DEFAULT_AMPLITUDE\"));\n        vibrator.Call(\"vibrate\", oneShot);\n    }\n}\n```\n\n### Implementing Java Interfaces from Script (Godot 4.7+)\n\n`JavaClassWrapper.create_proxy(object: Object, interfaces: PackedStringArray) -> JavaObject` implements the given Java interfaces using a Godot object — the object's method signatures must match the Java interfaces' method signatures, and Java calls route to the matching method. `create_sam_callback(sam_interface: String, callable: Callable) -> JavaObject` covers single-abstract-method (SAM) interfaces with a `Callable` matching the SAM method's parameters and return type. Both return `null` on every platform except Android.\n\n```gdscript\nclass PrintProxy:\n    func println(content: String) -> void:\n        print(content)\n\nfunc _demo() -> void:\n    var print_proxy := PrintProxy.new()\n    var printer := JavaClassWrapper.create_proxy(print_proxy, [\"android.util.Printer\"])\n    printer.println(\"Hello Godot World!\")\n\n    var cb := func(content: String) -> void: print(content)\n    var callback := JavaClassWrapper.create_sam_callback(\"android.util.Printer\", cb)\n    callback.println(\"Hello Godot World!\")\n```\n\nThe docs are GDScript-only here. `CreateProxy` matches methods by their registered name, so a C# implementation class would need method names matching the Java interface exactly — prefer `CreateSamCallback` from C#:\n\n```csharp\nvar cb = Callable.From((string content) => GD.Print(content));\nvar callback = JavaClassWrapper.CreateSamCallback(\"android.util.Printer\", cb);\ncallback.Call(\"println\", \"Hello Godot World!\");\n```\n\n---\n\n## 5. Device features & safe area\n\n`DisplayServer.get_display_safe_area() -> Rect2i` (Android\u002FiOS) returns the usable region inside notches\u002Fcutouts; `get_display_cutouts()` (Android) lists the cutout rects. Motion sensors live on `Input` (`get_accelerometer\u002Fgravity\u002Fgyroscope\u002Fmagnetometer`, returning `Vector3`, Android\u002FiOS only).\n\n### GDScript\n\n```gdscript\nfunc _ready():\n    var safe := DisplayServer.get_display_safe_area() # Rect2i\n    $UI.position = safe.position\n    $UI.size = safe.size\n```\n\n### C# Equivalent\n\n```csharp\npublic override void _Ready()\n{\n    Rect2I safe = DisplayServer.GetDisplaySafeArea();\n    var ui = GetNode\u003CControl>(\"UI\");\n    ui.Position = safe.Position;\n    ui.Size = safe.Size;\n}\n```\n\nNative file dialogs (`DisplayServer.file_dialog_show()`) are supported on Android; since Godot 4.7 the native file picker works on all devices — the Android version check gating `FEATURE_NATIVE_DIALOG_FILE` support was removed ([GH-115257](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F115257)).\n\n> **Godot 4.7+:** For on-screen touch joysticks, use the built-in `VirtualJoystick` Control node instead of a hand-rolled `TouchScreenButton` rig — see **input-handling** (`references\u002Ftouch.md`, \"VirtualJoystick (Godot 4.7+)\") for the full API.\n\n### Device Orientation Signal (Godot 4.7+)\n\n`DisplayServer.orientation_changed(orientation: int)` (Android\u002FiOS) fires when the device orientation changes: `1` portrait, `2` landscape, `0` undefined.\n\n```gdscript\nfunc _ready() -> void:\n    DisplayServer.orientation_changed.connect(_on_orientation_changed)\n\nfunc _on_orientation_changed(orientation: int) -> void:\n    _relayout_hud(orientation == 2)  # 1 portrait, 2 landscape, 0 undefined.\n```\n\n```csharp\npublic override void _Ready()\n{\n    DisplayServer.Singleton.Connect(DisplayServer.SignalName.OrientationChanged,\n        Callable.From((long orientation) => RelayoutHud(orientation == 2)));\n}\n```\n\n> **Changed in Godot 4.8:** The `orientation` parameter is now typed as the new `DisplayServer.SensorOrientation` enum (`SENSOR_ORIENTATION_UNDEFINED` 0, `_PORTRAIT` 1, `_LANDSCAPE` 2) and the docs say *screen* orientation. The values are unchanged, so the handlers above keep working. Code that uses the generated C# `OrientationChanged` event may need updating, since its delegate type changes (per the draft 4.8 migration guide; unconfirmed).\n\n---\n\n## 6. Mobile performance & renderer\n\nUse the **Mobile** (or **Compatibility**) renderer; prefer Compatibility on the iOS simulator. Enable `rendering\u002Ftextures\u002Fvram_compression\u002Fimport_etc2_astc = true` (ETC2\u002FASTC) for Android texture compression. Keep single-arch APKs small; AABs split per-device automatically. Defer deep draw-call\u002Fbatching tuning to **godot-optimization**.\n\n---\n\n## 7. C# on mobile\n\nC# Android\u002FiOS export is **Godot 4.2+ but experimental**. **Android C# export requires .NET 9+** (with Godot 4.5); iOS export only from macOS (the export also builds arm64 + x86_64 simulator assemblies). **C# cannot export to Web.** Test the C# export pipeline early — it is the riskiest part of a C# mobile project.\n\n> **Changed in Godot 4.8:** Every C# project, not only Android, needs **.NET 10** (`net10.0`); 4.8 writes `net10.0` for Android too. The \".NET 9+\" above applies to Godot 4.5 to 4.7.\n\n> **Deeper:** [Plugins (Android v2 \u002F iOS)](references\u002Fplugins.md) · [In-app purchases & ads](references\u002Fiap-and-ads.md) · [Crash debugging](references\u002Fcrash-debugging.md)\n\n---\n\n## Implementation Checklist\n\n- [ ] Release keystore (Android) \u002F provisioning + Team ID (iOS) configured\n- [ ] AAB for Play uploads; Gradle build installed if using v2 plugins or IAP\n- [ ] Autosave wired to `NOTIFICATION_APPLICATION_PAUSED` (iOS ~5 s budget respected)\n- [ ] Required permissions enabled in the preset AND requested at runtime\n- [ ] JavaClassWrapper usage labeled Godot 4.4+; fallbacks for 4.3 if needed\n- [ ] UI anchored inside `get_display_safe_area()`; notch\u002Fcutout handled\n- [ ] Mobile\u002FCompatibility renderer + ETC2\u002FASTC compression enabled\n- [ ] C# projects: verified .NET 9+ for Android export (Godot 4.8: .NET 10)\n- [ ] Play OBB\u002FAPK expansion files moved to App Bundles with Play Asset Delivery, or the Godot OBB plugin installed (built-in support removed in Godot 4.7)\n- [ ] PiP (Android): aspect ratio + auto-enter configured; HUD reacts to the PIP_MODE notifications (Godot 4.7+)\n",{"name":5,"description":7},"master","60c28fdc40706a24576731e9fb3508b9c95258ad","skills\u002Fmobile-development",63,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter","https:\u002F\u002Fgithub.com\u002Fjame581","https:\u002F\u002Fjanmesarc.online\u002F","Software engineer. My biggest passion is game development.","2026-11-14 20:45:49",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add jame581\u002FGodotPrompter --skill mobile-development",{"tool":58,"command":59},"bunx","bunx skills add jame581\u002FGodotPrompter --skill mobile-development",{"tool":61,"command":62},"pnpm","pnpm dlx skills add jame581\u002FGodotPrompter --skill mobile-development","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fmobile-development\u002FSKILL.md",true,[66,72,76],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fcrash-debugging.md","REFERENCE","参考文档",1280,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fmobile-development\u002Freferences\u002Fcrash-debugging.md",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fiap-and-ads.md",3683,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fmobile-development\u002Freferences\u002Fiap-and-ads.md",{"path":77,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fplugins.md",6327,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fmobile-development\u002Freferences\u002Fplugins.md",[81,100,121,150,174,192],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":38},"01M6KRFE5BR2PSD08ZKDAS66R7","xr-development","Use when building VR\u002FAR\u002FXR applications — OpenXR setup, XROrigin3D, hand tracking, controllers, passthrough, and Meta Quest deployment in Godot 4.3+","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fxr-development\u002FSKILL.md",[],[88,21,22,89,90,91,92,93,94,95,96,33,97,98,99],"xr development","deployment","godot","vr","setup","tracking","godot 4","ar","hand","Meta","applications","quest",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":38},"01M6KRF8GZTG1TAS506MFBSGFC","web-services","Use when a Godot game calls a web server — HTTPRequest, downloads, REST\u002FJSON APIs, auth headers, WebSocketPeer clients, TLS, retries, and keeping secrets out of the build. Not for game networking\u002FRPCs (multiplayer-basics) or browser export (web-export)","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-services\u002FSKILL.md",[],[107,108,109,110,111,112,113,114,33,22,90,115,116,117,118,119,120],"web services","web","services","tls","retries","calling","auth","downloads","clients","headers","secrets","json","build","REST",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":132,"publishedAt":38},"01M6KRF38Q4WSKAYFS56PG87T0","web-export","Use when shipping a Godot game to the browser — Web export preset options, threads vs no-threads and COOP\u002FCOEP headers, hosting on itch.io or your own server, PWA, JavaScriptBridge, user:\u002F\u002F persistence, audio and input limits, and load size","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002FSKILL.md",[127],{"categoryNo":128,"categoryName":129,"taxonomyType":130,"taxonomyTypeDesc":131},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[108,25,133,134,135,136,137,138,116,139,140,22,141,142,143,144,145,146,33,147,148,149],"web export","threads","limits","shipping","size","options","hosting","input","Coop","preset","browser","game","io","load","pwa","Audio","server",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":164,"publishedAt":38},"01M6KREYFETEBH62ZTN6EZH2X3","using-godot-prompter","Bootstrap skill — establishes how to find and use GodotPrompter skills, with platform-specific tool mapping","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fusing-godot-prompter\u002FSKILL.md",[156,159],{"categoryNo":157,"categoryName":158,"taxonomyType":130,"taxonomyTypeDesc":131},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":160,"categoryName":161,"taxonomyType":162,"taxonomyTypeDesc":163},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[90,165,166,167,168,33,169,170,171,172,173],"using godot prompter","find","with","bootstrap","tool","platform","mapping","how","how to",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":180,"publishedAt":38},"01M6KRER5G7EQWKGAFN8QJKQ69","tween-animation","Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI\u002Fgameplay motion recipes","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Ftween-animation\u002FSKILL.md",[],[181,182,33,183,184,185,186,187,188,189,190,22,191],"tween animation","Animation","motion","parallel","gameplay","chaining","ui","recipes","common","implementing","sequences",{"skillNo":193,"name":194,"nameZh":6,"description":195,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":196,"categories":197,"keywords":198,"publishedAt":38},"01M6KREKGCQMVDV8WX7HWX8BZG","state-machine","Use when building a state machine or refactoring logic into one — enum, node, and resource-based FSM patterns with trade-offs. Not for adding states to an existing one","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fstate-machine\u002FSKILL.md",[],[199,200,201,90,22,202,203,204,205,206,167,33,190,207],"state","state machine","machine","patterns","node","fsm","state machines","trade","trade-offs"]