在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):SwiftJava/swift-android-kotlin开源软件地址(OpenSource Url):https://github.com/SwiftJava/swift-android-kotlin开源编程语言(OpenSource Language):Swift 78.3%开源软件介绍(OpenSource Introduction):Kotlin example for the Android Swift toolchain.An example application for mixing Swift and Kotlin in an Android application. This allows you to reuse model layer code from your iOS application when porting to Android. The "binding" between the Kotlin or Java code and Swift is completely type safe with all JNI code automatically generated using a script. Building the Swift code is performed using the Swift Package manager and a small gradle plugin. Requires a build of the latest Android toolchain downloadable here. Once you've extracted the toolchain, run To create a new application, decide on a pair of interfaces to connect to and from your Swift
code and place them in a Java Source. Use the command This example is coded to work with version 7 of the toolchain which has some additional requirements to work around requirements of the Swift port of Foundation. The cache directory used by web operations needs to be setup in the environment variable "TMPDIR". This would usually be the value of Context.getCacheDir().getPath() from the java side. In addition, to be able to use SSL you need to add a CARoot info file to the application's raw resources and copy it to this cache directory to be picked up by Foundation as follows:
If you don't want peer validation you have the following option (not recommended at all)
Simple demo of Swift code accessed over JNI.To build, setup the Gradle plugin, then run This demo is licensed under the Creative Commons CC0 license: do whatever you want. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论