Category "kotlin"

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 (

android camera2 Api autoflash not working properly, the first picture is taken before the flash fires

I'm using camera 2 API, my project is heavily based on the archived project from google: https://github.com/googlearchive/android-Camera2Basic/ I'm starting the

Jetpack Compose take screenshot of composable function?

I want to take screenshot of specific composable function on Jetpack Compose. How can I do this? Please, anyone help me. I want to take screenshot of composable

How to Unsubscribe from coroutine flows right after RoomDb call

I'm trying to query Room database(action 1) and then based on the returned results perform another action on the same table. however I noticed that every time I

Cancel viewModelScope and re-use it later on

I'm using Coroutines for dealing with async jobs: viewModelScope.launch { val userResponse = getUsers() //suspendable function } What I want to do is stop

Kotlin Android Studio: org.junit.ComparisonFailure with NBSP

I have this code @Test fun price_twelve_cupcakes() { val viewModel = OrderViewModel() viewModel.setQuantity(12) viewModel.price.observeForever {}

Downloadable Font's font weight not working android

I was following this official guide and wanted to use Poppins font for my project. The font has changed but the font weight property does not seem to be work. I

How to remove padding between AlertDialog and title/text with Compose

Using compose, I want to create something like this : Problem is using compose AlertDialog I only achieve to get this : There is a padding between the AlertDi

How to remove padding between AlertDialog and title/text with Compose

Using compose, I want to create something like this : Problem is using compose AlertDialog I only achieve to get this : There is a padding between the AlertDi

What is the better or easier way to create "nested" menus in Jetpack Compose?

So in XML you were able to structure menu items and nest them like this. But in jetpack compose, I am unable to figure out how this would work. I already read