Swift on Android: Building a Idiomatic Cross-Platform Library with Swift/Java Interop
At Frameo we distribute multiple Android apps and an iOS app to over 20 million users. Traditionally, sharing core features meant maintaining separate Swift and Java implementations, doubling the effort and the potential for bugs. With the recent advancements in the swift-java project and the official Swift Android SDK, we are now able to build cross-platform libraries in Swift with little effort, sharing core functionality across our products. Not only does it save time and costs, but we are also able to take advantage of Swift's performance, safety and the existing library ecosystem! In this talk we will go over what is new since the release of the JNI mode last summer. We will cover how these new additions allows us to generate idiomatic Java libraries for our Android developers, while preserving Swift's core features such as protocols and Swift Concurrency. We will walk through a feature we wanted to build in the Frameo software and how we wrote a Swift package for end-to-end encrypted communication. We demonstrate how little effort it takes to wrap that package using the swift-java JNI mode and compile it using the Android SDK, such that we have a cross-platform library we can use on both iOS and Android. Speaker Bio Mads is a Tech Lead at Frameo in Denmark. During Google Summer of Code 2025, he worked on bringing JNI support to the jextract tool, which is part of the Swift Java interoperability project. Since then he has continued working on the JNI mode. At Frameo he uses this work to build cross-platform libraries in Swift, for both Android and iOS. Outside of coding, he spends a lot of time playing sports and music!
Download
0 formatsNo download links available.