Skip to content

Commit 770193b

Browse files
committed
Update README to push swift-java as the recommended approach
Also, showcase the pure Swift example separately.
1 parent 23adeff commit 770193b

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
# Swift Android Examples
22

3-
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.
3+
This repository contains example applications that demonstrate how to use the
4+
[Swift SDK for Android](https://swift.org/install). Each example showcases different
5+
integration patterns for Swift on Android. It is highly recommended that you use
6+
the automated swift-java interop that generates bindings for you; the others are
7+
merely provided as examples for those who want to dig deeper and see the raw JNI,
8+
or not use Java at all.
49

510
## Available Examples
611

7-
Examples using [swift-java](https://github.com/swiftlang/swift-java) to generate necessary Swift/Java bridging:
8-
- **[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 using [swift-java](https://github.com/swiftlang/swift-java).
12+
Examples using [swift-java](https://github.com/swiftlang/swift-java) to generate
13+
the necessary Swift/Java bridging:
14+
- **[hello-swift-java](hello-swift-java/)** - application that demonstrates how
15+
to call Swift code from an Android app with automatically generated Java wrappers
16+
and JNI code.
17+
18+
An example of a purely native Swift app, which calls no Java APIs:
19+
- **[native-activity](native-activity/)** - complete native Android activity with
20+
OpenGL ES rendering written entirely in Swift.
921

1022
Examples using raw JNI, without generated bridging sources:
1123
- **[hello-swift-raw-jni](hello-swift-raw-jni/)** - basic Swift integration that calls a Swift function.
1224
- **[hello-swift-raw-jni-callback](hello-swift-raw-jni-callback/)** - demonstrates bidirectional communication with Swift timer callbacks updating Android UI.
1325
- **[hello-swift-raw-jni-library](hello-swift-raw-jni-library/)** - shows how to package Swift code as a reusable Android library component.
14-
- **[native-activity](native-activity/)** - complete native Android activity with OpenGL ES rendering written entirely in Swift.

0 commit comments

Comments
 (0)