Category "kotlin"

Kotlin Flow returned from Room does not update when an insert is performed from another Fragment/ViewModel

I have a Room database that returns a Flow of objects. When I insert a new item into the database, the Flow's collect function only triggers if the insert was p

Reading a text file in Android Studio Kotlin and making pointers

I am fairly new to Android + Kotlin, however I am wondering if there is a faster way to read a text (.pgn) file and mark pointers to places in the file for late

Router.router path param is empty

I have a API,created by val router = Router.router(vertx) router.patch("/api/v2/user/:userId/names") if user id is not passed getting message - "error":

kotlin.UninitializedPropertyAccessException: lateinit property postFragment has not been initialized on FragmentStateAdapter Dagger Hilt

i tried to implement viewpager2 with tabLayout with dagger-hilt. then i got error when implementing viewpager2 on dagger hilt "kotlin.UninitializedPropertyAcces

How can I passs a method except parameter in Kotlin?

I hope to pass a method which implement MediaRecorder.OnInfoListener. At present I use Code A to pass the method which implement MediaRecorder.OnInfoListener.

Spring cloud stream with kafka streams binder: how to set `trusted.packages` for a Stream Processor (that's different than consumer and producer)

I have a simple stream processor (not consumer/producer) that looks like this (Kotlin) @Bean fun processFoo():Function<KStream<FooName, FooAddress>, KS

Convert ByteArray to Base64 in Kotlin

I am trying to convert a ByteArray to Base64 in a Spring project, written in Kotlin. I have checked existing posts but they didnt help me. Actually I am trying

The most efficient solution for finding the minimum value

I have a list of Sugar. The Sugar class has two field: price and weight: data class Sugar(var price: Double, var weight: Double) And I need to find max/min val

How to define a variable which implement the interface in Kotlin?

I hope to define a variable mAction which implement the interface MediaRecorder.OnInfoListener . But Code A isn't correct, how can I fix it? Code A val mActio

How we can mock a CoroutineDatabase in ktor?

I use the KMongo tool How we can mock a Coroutine Database? How can we mock our database in a koin module? Is there a way to do this? Thanks for guiding me Meth

How can I override logRequest/logResponse to log custom message in Ktor client logging?

Currently, the ktor client logging implementation is as below, and it works as intended but not what I wanted to have. public class Logging( public val log

No broker/node available in test with Kafka in TestContainers

I am trying to create a bare-bones skeleton integration test for Kafka with TestContainers: just publish message to topic and check it arrives to it (entire set

How can I solve this issue on Mac M1 Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64

I solved this issue with the code below in my build.gradle allprojects { configurations.all { resolutionStrategy { force 'org.xerial:sqlite-jdbc:3

How to increase capture default camera image quality

I am using default camera and capturing image. we have converted Base64 image after converting image quality is blur and image size getting very low below 50kb.

org.kodein.di.Kodein$NotFoundException: No binding found for bind<LLApi>() with ?<LoginFragment>().? { ? }

Iam doing a project with objectbox + retrofit + kodein. But I'm getting this error. org.kodein.di.Kodein$NotFoundException: No binding found for bind<LLApi&g

Android app crash okhttp3 HTTP FAILED: javax.net.ssl.SSLException: Read error: I/O error during system call, Software caused connection abort

I am working on android native kotlin project. I am testing app in android real Oneplus 6 device with Android version 10. Please find below details from build.

Command execution in kotlin

I want to execute this command: Runtime.getRuntime().exec("adb shell dpm set-device-owner com.example.msgshareapp/.AdminReceiver") This didn't work,

TomTom Map api black dots on the map

I am using the TomTom map API. But when I'm using the map there are so many black dots and boxes(as seen on the image below). When I zoom in the dots and boxes

How to manually update a kotlin flow

I'm trying to update the source of a Flow in Kotlin and I'm not sure if this is the right approach and if it's possible with Flow at all. I have a database cont

JSON Serialization / Deserialization Kotlin Android Jetpack Compose Table

I'm in the process of creating a table section in Jetpack Compose that deserializes the data from a JSON. At this point, I'm simply trying to display the data (