# Matriz de plataformas y funciones

> El modelo multimódulo (core + launchers) y lo que soporta cada plataforma.

Source: https://crossfly.dev/es/docs/platforms/overview — CrossFly documentation. Full docs as one file: https://crossfly.dev/llms-full.txt

# Matriz de plataformas y funciones

CrossFly es un proyecto **multimódulo Gradle**: la UI y la lógica viven en **`core`** (neutro), y cada
**launcher** (`lwjgl3`, `android`, `ios`, `web`) solo hace el *bootstrap* del SO. El mismo código Java corre
en los cuatro destinos.

<div class="cf-diagram">
<svg role="img" id="my-svg" width="1005" height="164" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="flowchart" style="max-width: 1004.98px; background-color: transparent;" viewBox="0 0 1004.984375 164" role="graphics-document document" aria-roledescription="flowchart-v2"><style>#my-svg{font-family:Manrope,system-ui,sans-serif;font-size:14px;fill:var(--text);}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#my-svg .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#my-svg .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#my-svg .error-icon{fill:var(--bg-elev);}#my-svg .error-text{fill:var(--text-dim);stroke:var(--text-dim);}#my-svg .edge-thickness-normal{stroke-width:1px;}#my-svg .edge-thickness-thick{stroke-width:3.5px;}#my-svg .edge-pattern-solid{stroke-dasharray:0;}#my-svg .edge-thickness-invisible{stroke-width:0;fill:none;}#my-svg .edge-pattern-dashed{stroke-dasharray:3;}#my-svg .edge-pattern-dotted{stroke-dasharray:2;}#my-svg .marker{fill:var(--text-dim);stroke:var(--text-dim);}#my-svg .marker.cross{stroke:var(--text-dim);}#my-svg svg{font-family:Manrope,system-ui,sans-serif;font-size:14px;}#my-svg p{margin:0;}#my-svg .label{font-family:Manrope,system-ui,sans-serif;color:var(--text);}#my-svg .cluster-label text{fill:var(--text-dim);}#my-svg .cluster-label span{color:var(--text-dim);}#my-svg .cluster-label span p{background-color:transparent;}#my-svg .label text,#my-svg span{fill:var(--text);color:var(--text);}#my-svg .node rect,#my-svg .node circle,#my-svg .node ellipse,#my-svg .node polygon,#my-svg .node path{fill:var(--bg-soft);stroke:var(--border-strong);stroke-width:1px;}#my-svg .rough-node .label text,#my-svg .node .label text,#my-svg .image-shape .label,#my-svg .icon-shape .label{text-anchor:middle;}#my-svg .node .katex path{fill:var(--text-dim);stroke:var(--text-dim);stroke-width:1px;}#my-svg .rough-node .label,#my-svg .node .label,#my-svg .image-shape .label,#my-svg .icon-shape .label{text-align:center;}#my-svg .node.clickable{cursor:pointer;}#my-svg .root .anchor path{fill:var(--text-dim)!important;stroke-width:0;stroke:var(--text-dim);}#my-svg .arrowheadPath{fill:rgba(255, 255, 255, 0);}#my-svg .edgePath .path{stroke:var(--text-dim);stroke-width:1px;}#my-svg .flowchart-link{stroke:var(--text-dim);fill:none;}#my-svg .edgeLabel{background-color:var(--bg-elev);text-align:center;}#my-svg .edgeLabel p{background-color:var(--bg-elev);}#my-svg .edgeLabel rect{opacity:0.5;background-color:var(--bg-elev);fill:var(--bg-elev);}#my-svg .labelBkg{background-color:rgba(255, 255, 255, 0.5);}#my-svg .cluster rect{fill:var(--bg-elev);stroke:hsl(0, 0%, 90%);stroke-width:1px;}#my-svg .cluster text{fill:var(--text-dim);}#my-svg .cluster span{color:var(--text-dim);}#my-svg div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:Manrope,system-ui,sans-serif;font-size:12px;background:var(--bg-elev);border:1px solid hsl(0, 0%, 90%);border-radius:2px;pointer-events:none;z-index:100;}#my-svg .flowchartTitleText{text-anchor:middle;font-size:18px;fill:var(--text);}#my-svg rect.text{fill:none;stroke-width:0;}#my-svg .icon-shape,#my-svg .image-shape{background-color:var(--bg-elev);text-align:center;}#my-svg .icon-shape p,#my-svg .image-shape p{background-color:var(--bg-elev);padding:2px;}#my-svg .icon-shape .label rect,#my-svg .image-shape .label rect{opacity:0.5;background-color:var(--bg-elev);fill:var(--bg-elev);}#my-svg .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#my-svg .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#my-svg .node .neo-node{stroke:var(--border-strong);}#my-svg [data-look="neo"].node rect,#my-svg [data-look="neo"].cluster rect,#my-svg [data-look="neo"].node polygon{stroke:url(#my-svg-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg [data-look="neo"].swimlane.cluster rect{filter:none;}#my-svg [data-look="neo"].node path{stroke:url(#my-svg-gradient);stroke-width:1px;}#my-svg [data-look="neo"].node .outer-path{filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg [data-look="neo"].node .neo-line path{stroke:var(--border-strong);filter:none;}#my-svg [data-look="neo"].node circle{stroke:url(#my-svg-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg [data-look="neo"].node circle .state-start{fill:var(--text-dim);}#my-svg [data-look="neo"].icon-shape .icon{fill:url(#my-svg-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg [data-look="neo"].icon-shape .icon-neo path{stroke:url(#my-svg-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#my-svg :root{--mermaid-font-family:Manrope,system-ui,sans-serif;}</style><g><marker id="my-svg_flowchart-v2-pointEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-pointStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="4.5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"><path d="M 0 5 L 10 10 L 10 0 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-pointEnd-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="11.5" refY="7" markerUnits="userSpaceOnUse" markerWidth="10.5" markerHeight="14" orient="auto"><path d="M 0 0 L 11.5 7 L 0 14 z" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-pointStart-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="1" refY="7" markerUnits="userSpaceOnUse" markerWidth="11.5" markerHeight="14" orient="auto"><polygon points="0,7 11.5,14 11.5,0" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-circleEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="11" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-circleStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-1" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-circleEnd-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refY="5" refX="12.25" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-circleStart-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-2" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-crossEnd" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="12" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-crossStart" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="-1" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-v2-crossEnd-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="17.7" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5;"/></marker><marker id="my-svg_flowchart-v2-crossStart-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="-3.5" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5; stroke-dasharray: 1, 0;"/></marker><g class="root"><g class="clusters"/><g class="edgePaths"><path d="M356.469,48.113L314.159,53.761C271.849,59.409,187.229,70.704,144.919,79.852C102.609,89,102.609,96,102.609,99.5L102.609,103" id="my-svg-L_Core_L1_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_Core_L1_0" data-points="W3sieCI6MzU2LjQ2ODc1LCJ5Ijo0OC4xMTI4NjIxMDg5MjIzNjR9LHsieCI6MTAyLjYwOTM3NSwieSI6ODJ9LHsieCI6MTAyLjYwOTM3NSwieSI6MTA3fV0=" data-look="classic" marker-end="url(#my-svg_flowchart-v2-pointEnd)"/><path d="M410.32,57L399.587,61.167C388.854,65.333,367.388,73.667,356.655,81.333C345.922,89,345.922,96,345.922,99.5L345.922,103" id="my-svg-L_Core_L2_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_Core_L2_0" data-points="W3sieCI6NDEwLjMxOTc2MDEwMTAxMDEsInkiOjU3fSx7IngiOjM0NS45MjE4NzUsInkiOjgyfSx7IngiOjM0NS45MjE4NzUsInkiOjEwN31d" data-look="classic" marker-end="url(#my-svg_flowchart-v2-pointEnd)"/><path d="M536.54,57L547.273,61.167C558.006,65.333,579.472,73.667,590.205,81.333C600.938,89,600.938,96,600.938,99.5L600.938,103" id="my-svg-L_Core_L3_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_Core_L3_0" data-points="W3sieCI6NTM2LjUzOTYxNDg5ODk4OTgsInkiOjU3fSx7IngiOjYwMC45Mzc1LCJ5Ijo4Mn0seyJ4Ijo2MDAuOTM3NSwieSI6MTA3fV0=" data-look="classic" marker-end="url(#my-svg_flowchart-v2-pointEnd)"/><path d="M590.391,46.842L638.178,52.701C685.966,58.561,781.542,70.281,829.329,79.64C877.117,89,877.117,96,877.117,99.5L877.117,103" id="my-svg-L_Core_L4_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style=";" data-edge="true" data-et="edge" data-id="L_Core_L4_0" data-points="W3sieCI6NTkwLjM5MDYyNSwieSI6NDYuODQxNzAzNDM3MDY0NTZ9LHsieCI6ODc3LjExNzE4NzUsInkiOjgyfSx7IngiOjg3Ny4xMTcxODc1LCJ5IjoxMDd9XQ==" data-look="classic" marker-end="url(#my-svg_flowchart-v2-pointEnd)"/></g><g class="edgeLabels"><g class="edgeLabel"><g class="label" data-id="L_Core_L1_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_Core_L2_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_Core_L3_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" data-id="L_Core_L4_0" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" class="labelBkg" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="edgeLabel"></span></div></foreignObject></g></g></g><g class="nodes"><g class="node default" id="my-svg-flowchart-Core-0" data-look="classic" transform="translate(473.4296875, 32.5)"><rect class="basic label-container" style="" x="-116.9609375" y="-24.5" width="233.921875" height="49"/><g class="label" style="" transform="translate(-88.9609375, -10.5)"><rect/><foreignObject width="177.921875" height="21"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p><b>core</b> — UI + lógica (neutral)</p></span></div></foreignObject></g></g><g class="node default" id="my-svg-flowchart-L1-2" data-look="classic" transform="translate(102.609375, 131.5)"><rect class="basic label-container" style="" x="-94.609375" y="-24.5" width="189.21875" height="49"/><g class="label" style="" transform="translate(-66.609375, -10.5)"><rect/><foreignObject width="133.21875" height="21"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>🖥️ lwjgl3 → LWJGL3</p></span></div></foreignObject></g></g><g class="node default" id="my-svg-flowchart-L2-4" data-look="classic" transform="translate(345.921875, 131.5)"><rect class="basic label-container" style="" x="-98.703125" y="-24.5" width="197.40625" height="49"/><g class="label" style="" transform="translate(-70.703125, -10.5)"><rect/><foreignObject width="141.40625" height="21"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>🤖 android → Android</p></span></div></foreignObject></g></g><g class="node default" id="my-svg-flowchart-L3-6" data-look="classic" transform="translate(600.9375, 131.5)"><rect class="basic label-container" style="" x="-106.3125" y="-24.5" width="212.625" height="49"/><g class="label" style="" transform="translate(-78.3125, -10.5)"><rect/><foreignObject width="156.625" height="21"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>🍎 ios → RoboVM (AOT)</p></span></div></foreignObject></g></g><g class="node default" id="my-svg-flowchart-L4-8" data-look="classic" transform="translate(877.1171875, 131.5)"><rect class="basic label-container" style="" x="-119.8671875" y="-24.5" width="239.734375" height="49"/><g class="label" style="" transform="translate(-91.8671875, -10.5)"><rect/><foreignObject width="183.734375" height="21"><div xmlns="http://www.w3.org/1999/xhtml" style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;"><span class="nodeLabel"><p>🌐 web → TeaVM + WebGL2</p></span></div></foreignObject></g></g></g></g></g><defs><filter id="my-svg-drop-shadow" height="130%" width="130%"><feDropShadow dx="4" dy="4" stdDeviation="0" flood-opacity="0.06" flood-color="var(--text-dim)"/></filter></defs><defs><filter id="my-svg-drop-shadow-small" height="150%" width="150%"><feDropShadow dx="2" dy="2" stdDeviation="0" flood-opacity="0.06" flood-color="var(--text-dim)"/></filter></defs><linearGradient id="my-svg-gradient" gradientUnits="objectBoundingBox" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="var(--border-strong)" stop-opacity="1"/><stop offset="100%" stop-color="hsl(0, 0%, 90%)" stop-opacity="1"/></linearGradient></svg>
</div>

## Detección de plataforma
```java
if (Device.platform.isDesktop()) { ... }   // WINDOWS/LINUX/MACOS
if (Device.platform.isMobile()) { ... }     // ANDROID/IPHONE/IPAD
if (Device.platform.isIOS()) { ... }
```
`Platform`: `JAVA` · `WINDOWS` · `LINUX` · `IPHONE` · `ANDROID` · `IPAD` · `MACOS`.

## Matriz de soporte por función
| Función | 🖥️ Desktop | 🤖 Android | 🍎 iOS | 🌐 Web |
|---|:--:|:--:|:--:|:--:|
| Renderizar UI | ✅ | ✅ | ✅ | ✅ |
| Cámara / barcode | ⚠️¹ | ✅ | ✅ | ❌ |
| GPS / ubicación | ❌ | ✅ | ✅ | ❌ |
| Bluetooth BLE | ⚠️ | ✅ | ✅ | ❌ |
| Biometría | ⚠️ | ✅ | ✅ | ❌ |
| Mapas nativos | ✅ | ✅ | ✅ | ❌ |
| `WebContainer` | ✅ | ✅ | ✅² | ❌³ |
| Vibración | ❌ | ✅ | ✅ | ❌ |
| Voz (TTS/STT) | ⚠️ | ✅ | ✅ | ❌ |
| Persistencia de archivos | ✅ | ✅ | ✅ | ❌⁴ |
| HTTP | ✅ | ✅ | ✅ | ⚠️⁵ |

✅ soportado · ⚠️ limitado/varía · ❌ *stub* (no hace nada útil)
1. La cámara en desktop varía según el SO (ej.: Mac ARM puede devolver `null`).
2. `WKWebView` con `evaluateJavaScript` restringido ([iOS](/docs/platforms/ios)).
3. `createWebView()` devuelve `null` en la web ([Web](/docs/platforms/web-teavm)).
4. `Device.homeFolder` es `null` en la web.
5. HTTP en la web tiene restricciones (CORS, sin sockets) — `Utils.getRemoteFile` devuelve `null`.

> **Regla de oro para la portabilidad:** cualquier recurso de dispositivo puede no existir en un destino. Compruébalo
> antes de usarlo (`Device.platform`, `createWebView() != null`, retorno `null`) — ver
> [Integración nativa](/docs/platforms/native-integration).

## Qué página leer
| Destino | Página |
|---|---|
| 🖥️ iterar rápido | [Desktop (LWJGL3)](/docs/platforms/desktop-lwjgl3) |
| 🤖 móvil Android | [Android](/docs/platforms/android) |
| 🍎 iPhone/iPad | [iOS (RoboVM)](/docs/platforms/ios) |
| 🌐 navegador | [Web (TeaVM)](/docs/platforms/web-teavm) |
| conectar el código al SO | [Integración nativa](/docs/platforms/native-integration) |
| empaquetar y publicar | [Build y distribución](/docs/platforms/building-and-releasing) |
