|
1 | 1 | # Swift Android Examples |
2 | 2 |
|
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. |
4 | 9 |
|
5 | 10 | ## Available Examples |
6 | 11 |
|
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. |
9 | 21 |
|
10 | 22 | Examples using raw JNI, without generated bridging sources: |
11 | 23 | - **[hello-swift-raw-jni](hello-swift-raw-jni/)** - basic Swift integration that calls a Swift function. |
12 | 24 | - **[hello-swift-raw-jni-callback](hello-swift-raw-jni-callback/)** - demonstrates bidirectional communication with Swift timer callbacks updating Android UI. |
13 | 25 | - **[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