Swift on Android: A Comprehensive Guide to the SDK and Its Capabilities
<p>Since the preview <strong>Swift SDK for Android</strong> was announced, developers have shown great interest in understanding its inner workings and what the future holds. This article answers common questions about the technology, its current status, and the roadmap ahead. You can also experiment with the new <strong>Swift 6.3 SDK nightly previews</strong> to see the latest developments firsthand.</p><h2 id="how-it-works">How Swift Operates on Android</h2><p>Swift compiles directly to native machine code on Android, just as it does on most other platforms. This approach delivers performance comparable to C and C++ code built using the <em>Android Native Development Kit (NDK)</em>, while achieving a better balance between performance, safety, and usability. To make this possible, Swift apps on Android bundle a native runtime that implements many of its features, including the <strong>standard library</strong> and core libraries like <strong>Dispatch</strong> and <strong>Foundation</strong>.</p><figure style="margin:20px 0"><img src="https://picsum.photos/seed/2123491789/800/450" alt="Swift on Android: A Comprehensive Guide to the SDK and Its Capabilities" style="width:100%;height:auto;border-radius:8px" loading="lazy"><figcaption style="font-size:12px;color:#666;margin-top:5px"></figcaption></figure><p>However, since most Android APIs are only available through Java and Kotlin, Swift must call into the <strong>Android Runtime (ART)</strong>. This is where the Java interoperability project’s <strong>jextract</strong> and <strong>wrap-java</strong> tools come into play. These tools automatically create bindings that enable you to call Swift from Java or go the other way using the <strong>Java Native Interface (JNI)</strong>, allowing Swift to integrate seamlessly with the Android platform.</p><p>The <strong>jextract tool</strong> gained a JNI mode this summer. You can watch its author <strong>Mads Odgaard’s</strong> talk at the Server-Side Swift Conference and try out the example weather app he submitted in the <a href="#real-world">Android examples repository</a>.</p><h2 id="real-world">Real-World Production Usage</h2><p>While official Java interoperability is still under development, Android apps built using Swift have been in production for many years using homegrown Java interop. These apps have been collectively downloaded millions of times. Here are some notable examples:</p><ul><li><strong>Spark</strong> – A popular email client that uses Swift to share code between mobile iOS/Android and desktop macOS/Windows versions.</li><li><strong>flowkey</strong> – An interactive piano learning app built with Swift for Android for almost a decade.</li><li><strong>MediQuo</strong> – A healthcare app leveraging Swift for cross-platform development.</li><li><strong>Naturitas</strong> – An organic products marketplace running Swift in production.</li></ul><h2 id="ongoing-work">Ongoing Development and Community Efforts</h2><p>Grassroots community efforts to run Swift on Android began as soon as the language source was opened in 2015, and they continue to this day. The <strong>Android project board</strong> lists areas the workgroup considers important. For example, <strong>easy debugging</strong> is now a high priority. While debugging may work for small examples, we need to expand and test it more, making it simple to configure and access. This will likely mean tying the debugger and <strong>Swift Language Server Protocol tool (sourcekit-lsp)</strong> into Integrated Development Environments (IDEs) like <strong>Visual Studio Code</strong> and <strong>Android Studio</strong> – another issue on our board.</p><p>An <strong>Android workflow</strong> was added to the official Swift workflows for GitHub months ago, allowing you to easily try building your Swift packages with the Swift SDK for Android. Work is underway to let you build and test Swift packages seamlessly for Android, further reducing friction in cross-platform development.</p><p>For more details, visit the <a href="#how-it-works">How it works</a> section or explore the <a href="#real-world">production examples</a> above.</p>