From d3a5746800ef9ab308aff0d8044967bc9aa787b6 Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Tue, 28 Oct 2025 14:38:25 -0700 Subject: [PATCH 1/2] Expand opening text --- README.md | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index daa278a..5224689 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,38 @@ This repository contains example applications that demonstrate how to use the [Swift SDK for Android](https://swift.org/install). Each example showcases different -integration patterns for Swift on Android. It is highly recommended that you use -the automated swift-java interop that generates bindings for you; the others are -merely provided as examples for those who want to dig deeper and see the raw JNI, -or not use Java at all. +integration patterns for Swift on Android. -## Available Examples +## Getting Started + +The **[hello-swift-java](hello-swift-java/)** example is the recommended +approach for integrating Swift into Android applications. This example +demonstrates how to build a Swift library that can be seamlessly called from +Kotlin/Java code using [swift-java](https://github.com/swiftlang/swift-java), +which automatically generates the necessary Java wrappers and JNI bindings for +you. + +The example consists of two components: + +- **hashing-lib**: A Swift package that uses `swift-crypto` to provide SHA256 + hashing functionality +- **hashing-app**: A Kotlin Android app using Jetpack Compose UI that calls the + Swift library + +When you press the "Hash" button in the app, it calls directly from Kotlin into +Swift code to compute a SHA256 hash—no manual JNI code required. The swift-java +tooling handles all the bridging automatically, making it easy to expose Swift +APIs to your Android application with type safety and minimal boilerplate. + +This approach is ideal for production applications where you want to write +business logic, algorithms, or libraries in Swift while maintaining a standard +Kotlin/Java Android frontend. + +## Other Examples + +For those who want to explore alternative integration patterns or understand +lower level details of how Swift integrates with Android, there are a number of +other examples provided. Examples using [swift-java](https://github.com/swiftlang/swift-java) to generate the necessary Swift/Java bridging: From 826e909519032208774015ef7b680abd197bd7d9 Mon Sep 17 00:00:00 2001 From: finagolfin Date: Wed, 5 Nov 2025 21:39:47 +0530 Subject: [PATCH 2/2] Update README.md to remove redundant link and fix some copy --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5224689..795ccf3 100644 --- a/README.md +++ b/README.md @@ -25,21 +25,15 @@ Swift code to compute a SHA256 hash—no manual JNI code required. The swift-jav tooling handles all the bridging automatically, making it easy to expose Swift APIs to your Android application with type safety and minimal boilerplate. -This approach is ideal for production applications where you want to write -business logic, algorithms, or libraries in Swift while maintaining a standard -Kotlin/Java Android frontend. +This approach is ideal for production Android applications where you want to write +business logic, algorithms, or libraries in Swift, while maintaining a standard +Kotlin/Java frontend. ## Other Examples For those who want to explore alternative integration patterns or understand -lower level details of how Swift integrates with Android, there are a number of -other examples provided. - -Examples using [swift-java](https://github.com/swiftlang/swift-java) to generate -the necessary Swift/Java bridging: -- **[hello-swift-java](hello-swift-java/)** - application that demonstrates how -to call Swift code from an Android app with automatically generated Java wrappers -and JNI code. +lower-level details of how Swift integrates with Android, there are a number of +more manual examples provided. An example of a purely native Swift app, which calls no Java APIs: - **[native-activity](native-activity/)** - complete native Android activity with