https://kotlinlang.org
Join Slack
Can I use kotlin serialization in kotlin script?
e

Eugen Martynov

over 2 years ago
Can I use kotlin serialization in kotlin script?
e
e
+4
  • 6
  • 66
  • 544
Hello, I'm getting error `Unexpected JSON token at offset 11023: Expected start of the object '{', b...
y

Yousef

over 3 years ago
Hello, I'm getting error
Unexpected JSON token at offset 11023: Expected start of the object '{', but had ':' instead
JSON input: .....","type":"BLOGPOST","category":"e054042e-bc50-4743-a6f5-94d9.....
and I'm not sure why
y
e
r
  • 3
  • 10
  • 543
Is there a way to to use the AWS sdk in `shared` for KMP?
j

Justin Xu

over 2 years ago
Is there a way to to use the AWS sdk in
shared
for KMP?
j
k
+2
  • 4
  • 12
  • 542
How can I simulate a no network situation with `MockEngine`?
s

Saiedmomen

almost 7 years ago
How can I simulate a no network situation with
MockEngine
?
s
a
g
  • 3
  • 5
  • 542
Hi. Is there alternative for BulletSpan in Compose? In SpanStyle, it seems, there is not parameter f...
r

Roman Polach

about 4 years ago
Hi. Is there alternative for BulletSpan in Compose? In SpanStyle, it seems, there is not parameter for this
r
f
z
  • 3
  • 2
  • 542
how to convert Compose View to Bitmap?
s

Sololo

about 4 years ago
how to convert Compose View to Bitmap?
s
w
+2
  • 4
  • 3
  • 541
I want to Upload an image from Android to server as Binary form. the postman code is: `curl --locati...
a

Akram Bensalem

almost 4 years ago
I want to Upload an image from Android to server as Binary form. the postman code is:
curl --location -g --request POST '<https://svform.herokuapp.com/createUser/{userName}/{mobileNumber}>' \
--form 'profileImage=@"/Users/akram/Documents/14_07_2020-hbtu_kanpur_20509722.jpg"'
So I write a code like this:
@OptIn(InternalAPI::class)
suspend fun creatUser(
    context : Context,
    userName: String,
    mobileNumber:String,
    image: Uri,
) = client
    .submitFormWithBinaryData<MemberEntity>(
        url = "$POST_NEW_USER/$userName/$mobileNumber",
        formData = formData {
            append(
                key = "profileImage",
                value = getBinaryFile(context = context, contentUri = image)!!
            )
        },

            ){

        onUpload { bytesSentTotal, contentLength ->
            println("Sent $bytesSentTotal bytes from $contentLength")
        }
   }
I got an error of type :
Serializer for class 'BinaryItem' is not found.
When I add the ContentType, I got another error
Header(s) [Content-Type] are controlled by the engine and cannot be set explicitly
..... Please any help ?
a
a
  • 2
  • 4
  • 540
why are local extension properties not allowed, but functions are ? ```fun foo() { fun Int.x() = 42...
l

LastExceed

about 4 years ago
why are local extension properties not allowed, but functions are ?
fun foo() {
	fun Int.x() = 42 //ok
	val Int.y = 42 //error
}
l
j
e
  • 3
  • 4
  • 540
I have a multi-module Gradle build using Gradle Kotlin DSL. I would like to share a common configura...
d

diesieben07

over 4 years ago
I have a multi-module Gradle build using Gradle Kotlin DSL. I would like to share a common configuration for the Kotlin plugin across the modules, for example the "used experimental annotations". For example I have this snippet:
kotlin {
    sourceSets.all {
        languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
    }
}
I would like to move this into buildSrc so in the modules I can just do:
kotlin {
    configureExperimentalAnnotations()
}
To do this, I'd want to do this as an extension function on
KotlinProjectExtension
, but I have no idea which dependency I need in the
buildSrc
Gradle script for that.
kotlin-gradle-plugin
doesn't have it. Any advice?
d
t
u
  • 3
  • 33
  • 540
When wrapping a `WebView` in an `AndroidView` for use in a compose app, I have need of methods on th...
j

james

over 3 years ago
When wrapping a
WebView
in an
AndroidView
for use in a compose app, I have need of methods on the webview instance outside of the wrapped component for example a refresh button that calls
webView.loadUrl(…)
. How do I expose this to composable functions using the
WebView
component? Unsure how to expose this from the wrapped component
j
t
c
  • 3
  • 7
  • 540
Previous116117118Next

kotlinlang

A modern programming language that makes developers happier.

Powered by