kotlin-native Questions
1
On JVM I can use the following:
fun lineSeparatorLength(): Int = System.getProperty("line.separator").length
Can someone show me how to implement the same for Native/Desktop and JS?
Windowlight asked 13/8 at 20:28
2
In kotlin native there is memScoped function that automatically free allocated memory when control is going out of scope.
Is there something like destructors for local objects?
Rosales asked 25/6, 2017 at 15:33
2
Solved
I want to decode a json string containing a list of objects in a polymorphic class structure using kotlinx.serialization in a Kotlin Multiplatform project, but it works only on JVM, not on Native. ...
Americium asked 9/3, 2021 at 20:8
4
Solved
I'm currently developing a simple KMM module, which needs Context in order to perform some operations. I am aware of ways to achieve that with extending Application class and making dependency inje...
Weingarten asked 19/2, 2021 at 0:2
5
Solved
I was playing with the kotlin-native samples.
I wonder how I could get String from pinned ByteArray. Just want to print it in the console.
Ernestoernestus asked 24/3, 2018 at 17:35
3
Solved
A common pattern when doing coding challenges is to read many lines of input. Assuming you don't know in advance how many lines, you want to read until EOF (readLine returns null).
Also as a prefa...
Nesta asked 1/12, 2018 at 21:8
3
I am developing a Kotlin/Native app and I would like to pass arguments to it via Gradle.
There are tasks like runDebugExecutableNative. Is there some way to do something like:
./gradlew runDebugExe...
Wilie asked 27/10, 2020 at 10:36
4
I am working on a Kotlin/Native Multiplatform project that supports JVM, iOS, and macOS. My setup has the following modules:
- common
- ios
- jvm
- macos
I want to use some native code as an act...
Gorgonian asked 25/6, 2019 at 19:30
4
Solved
I'd like to know if there's a way in kotlin native to call a command via posix and receive it's terminal output. For example, I'd like to get the "git diff" command working without having to create...
Augmentation asked 20/7, 2019 at 10:27
2
Solved
I am trying to implement an observer for changes to a value for a give key in UserDefaults from the ios native part of a multiplatform project written in Kotlin/Native. Here is the code that I wrot...
Metts asked 14/5, 2020 at 11:35
5
With Kotlin native giving us the promise of cross platform development and native executables, is there an equivalent of the Java lib Retrofit for Kotlin Native? IOW is there a pure Kotlin networki...
Neolithic asked 13/12, 2017 at 17:57
2
Solved
UIKit is designed to be used through subclasses and overridden methods.
Typically, the drawRect objective-C method of UIView is implemented like this in SWIFT:
import UIKit
import Foundation
class...
Eolian asked 21/9, 2021 at 9:3
3
Solved
I am trying to execute a command via bash, for example konanc.
In KotlinJVM this would just be using Runtime.getRuntime().exec("..."), or creating a Process using the ProcessBuilder, however, none...
Kokura asked 21/7, 2018 at 23:43
1
I am working on an AES256 encryption algorithm in a Kotlin Multiplatform project targeting iOS.
I checked some of the existing libraries that implement this in pure Kotlin (such as krypto), but non...
Domination asked 15/7, 2021 at 15:52
3
Solved
I would like to do some basic filesystem operations on mingwX64 Windows (and possibly other platforms): open, close, read, rename, get metadata, list files in a directory.
I have found one project ...
Avellaneda asked 30/6, 2021 at 8:35
1
Solved
I have read multiple contents online but still not able to understand that is there a clear difference between Kotlin multiplatform mobile vs Kotlin Native?
Versus asked 23/6, 2021 at 16:39
2
I see yet another function in Kotlin/Native, that does not exist in the Kotlin JVM or JS. What does it?
Aerodynamics asked 3/9, 2018 at 9:32
1
I've read these SO posts 1, 2, 3 which faced a similar problem. I'm trying to use a .klib in my KMM Android project. The Klib is built from library.h C header. Here's what I did:
I built the Kotlin...
Outfitter asked 29/3, 2021 at 8:57
3
Solved
I am trying to serialize polymorphic classes using kotlinx.serialization with kotlin/native. I am using the sample provided in the serialization guide:
val module = SerializersModule {
polymorphic...
Paapanen asked 18/9, 2020 at 14:18
2
I have this function that makes a network request and writes results to SQLDelight database:
@Throws(Exception::class)
suspend fun updateData()
In iOS project in Xcode I see that this function is ...
Tormentil asked 29/12, 2020 at 21:28
1
Solved
I'm trying to make a Kotlin Multiplatform library to be used in both Android, JavaScript and iOS. This library is composed of multiple modules so that it can be easily extensible.
My problem right ...
Dead asked 4/3, 2021 at 8:21
0
I want to integrate C code into a Kotlin Multiplatform Mobile project using the cinterop tool. I already spent some time on the documentation on Kotlin Multiplatform and Kotlin/Native but I can't s...
Edsel asked 12/2, 2021 at 8:48
2
Solved
I created Kotlin native project to shared code between iOS and android.I did integration for cocoapods in-order to use in iOS project using POD file, Project successfully run on iOS and Android but...
Copperplate asked 8/2, 2020 at 11:51
1
Solved
I simplified the error, and I just have this class:
class TestClass{
private var string = "Hello"
fun testError() {
string= "It Works"
GlobalScope.launch(Dispatchers.Defaul...
Smith asked 16/12, 2020 at 18:30
5
I'm trying to learn how Kotlin Native works with this tutorial from JetBrains: https://kotlinlang.org/docs/tutorials/native/interop-with-c.html
But these tutorials are only fro macOS and Linux. So...
Popple asked 18/10, 2018 at 9:31
1 Next >
© 2022 - 2024 — McMap. All rights reserved.