|
| 1 | +--- |
| 2 | +layout: new-layouts/post |
| 3 | +published: false |
| 4 | +date: 2025-11-21 10:00:00 |
| 5 | +title: "Exploring the Swift SDK for Android" |
| 6 | +author: android-workgroup |
| 7 | +category: "Developer Tools" |
| 8 | +--- |
| 9 | + |
| 10 | +Since the announcement of [the preview Swift SDK for Android last month](/blog/nightly-swift-sdk-for-android/), |
| 11 | +the Android workgroup has seen a lot of questions about how it works and what's next. Please read on for those answers. |
| 12 | + |
| 13 | +### Swift in the World of Android |
| 14 | + |
| 15 | +Swift is a natively-compiled language to machine code and Android is no different. |
| 16 | +That renders it on par with C and C++ code built using the Android NDK, which are |
| 17 | +languages more geared towards performance, while Swift essays a happier balance between |
| 18 | +performance, safety, and usability. To enable that, Swift apps must bundle a native |
| 19 | +runtime for Android that implements many of its features, including its standard library and |
| 20 | +core libraries like Dispatch and [Foundation](/blog/foundation-preview-now-available/). |
| 21 | + |
| 22 | +However, since most Android APIs are only made available through Java and Kotlin |
| 23 | +in the Android Runtime (ART), a version of the Java Virtual Machine (JVM) |
| 24 | +optimized for mobile, we need to use the Java Native Interface (JNI) and write |
| 25 | +bindings both to call Swift from Java and go the other way. That is where the |
| 26 | +swift-java project's `jextract` tool and its [new support for generating such |
| 27 | +JNI bindings for you](/blog/gsoc-2025-showcase-swift-java/) comes in. Please |
| 28 | +watch its author Mads Odgaard's [Server-Side Swift Conference talk from last month](https://www.youtube.com/watch?v=tOH6V1IvTAc) |
| 29 | +and try out the tool for yourself with [this example Android app that he put together](https://github.com/swiftlang/swift-android-examples/tree/main/hello-swift-java). |
| 30 | + |
| 31 | +### Swift in Android app stores |
| 32 | + |
| 33 | +While Swift on Android may seem new, it's important to recognize that there are |
| 34 | +already millions of Android devices running Swift today. Production apps with |
| 35 | +substantial user bases have been shipping Swift on Android for years, proving |
| 36 | +the viability of this approach: |
| 37 | + |
| 38 | +- [Spark](https://play.google.com/store/apps/details?id=com.readdle.spark) - A popular email client using Swift to share code between mobile iOS/Android and desktop macOS/Windows versions |
| 39 | +- [flowkey](https://play.google.com/store/apps/details?id=com.flowkey.app) - This interactive piano learning app has been built with Swift on Android since the open-source release |
| 40 | +- [MediQuo](https://play.google.com/store/apps/details?id=com.mediquo.main) - A healthcare app leveraging Swift for cross-platform development |
| 41 | +- [Naturitas](https://play.google.com/store/apps/details?id=com.naturitas.android) - An organic products marketplace running Swift in production |
| 42 | + |
| 43 | +These aren't experimental apps or proofs of concept—they're real businesses serving |
| 44 | +real users at scale. The fact that millions of people use Swift-powered Android apps |
| 45 | +daily without knowing shows both the stability of Swift on Android and the |
| 46 | +practical benefits it provides to development teams sharing code across platforms. |
| 47 | + |
| 48 | +### Coming up Next |
| 49 | + |
| 50 | +Swift on Android [first got started as soon as the language was open-sourced a decade ago](https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151207/000171.html), |
| 51 | +but it is by no means done. [The Android project board lists areas we are working on](https://github.com/orgs/swiftlang/projects/17) |
| 52 | +and easy debugging is a high priority for us next. While it [mostly works in limited use now](https://github.com/swiftlang/llvm-project/issues/10831), |
| 53 | +we need to test it more and make it easy to access. That will likely mean tying |
| 54 | +the debugger and [Swift Language Server Protocol tool, sourcekit-lsp](/blog/gsoc-2025-showcase-code-completion/), |
| 55 | +into editors like [Visual Studio Code](/blog/gsoc-2025-showcase-swiftly-support-in-vscode/), |
| 56 | +Android Studio, and [CodeEdit](https://www.codeedit.app/), another issue on our board. |
| 57 | + |
| 58 | +### Sharing Logic Versus Sharing UI |
| 59 | + |
| 60 | +A common concern is that we do not provide a cross-platform GUI toolkit. As we |
| 61 | +write in [our draft vision document](https://github.com/swiftlang/swift-evolution/blob/807b844be42db582e434d1667fc907ae7a7a8775/visions/android.md), |
| 62 | +the Android workgroup has no plans to create such a GUI toolkit, but will instead |
| 63 | +curate a list of cross-platform UI tools. See our recent post in the Swift forums |
| 64 | +listing several popular and in-progress options. (editor: add this link) |
| 65 | + |
| 66 | +### Diving in |
| 67 | + |
| 68 | +Finally, we intend to bring you interviews and information from those using Swift |
| 69 | +on Android already, as pioneering companies like [Readdle](https://readdle.com/blog/swift-for-android-our-experience-and-tools) |
| 70 | +and [Flowkey](https://medium.com/@ephemer/why-we-put-an-app-in-the-android-play-store-using-swift-96ac87c88dfc) |
| 71 | +have written about using Swift on Android for the last decade. The Left Bit's Pierluigi Cifani |
| 72 | +[wrote about their experiences recently](https://forums.swift.org/t/thoughts-on-swift-for-android/80961), |
| 73 | +gave [a great talk at NSSpain 2025 a couple months ago](https://youtu.be/EIGl6GOo210), |
| 74 | +and was [interviewed by Swift Toolkit last month](https://www.swifttoolkit.dev/posts/dc-pier). |
| 75 | + |
| 76 | +Swift on Android has been a community effort for the last decade, snowballing |
| 77 | +from that initial patch to many businesses and developers making their livelihood |
| 78 | +with it today. Join us to make it even better! |
0 commit comments