Category "kotlin"

Time Format String

I am trying to decode the date-time receiving from my APIs in my required format "yyyy-MM-dd" I receive time in 2 format 1. "2022-05-05T11:32:12.542Z" 2. "2022-

context.createDatabase is not finding in preferences DataStore Android

I've just implemented Preferences by Android DataStore but I can't find "context.createDataStore" I added this dependency below implementation "androidx.datas

Jetpack Compose: Text remains black even when the theme is dark

The text in the app still remains black even if the theme is set to dark and background is dark. Just take a look at the code and screenshots below. Theme.kt (h

Is there a way to set auto refresh the jetpack compose preview?

I just started to use the Jetpack compose toolkit. I added the @Preview and a set showBackground = true, showSystemUi = true as parameters and it works really g

Return the result from a RecyclerView adaptor back to the MainActvity.kt?

I am trying do I return the result of the position from my Recyclerview Adapter, but I can't call the " adapter.setOnItemClickListener(this)" from MainAc

Save image to internal storage using ActivityResultContracts.GetContent(). - (Kotlin/Java/Android)

I'm new to file storage. My main goal is to take a picture with the camera, store it with good quality, then display it in an ImageView. I want to avoid asking

Can't remove a line from conf file

When I build my ktor project It fails and it tells me about a line which causes the failure. The line is located in the application.conf file: ktor { developme

ItemActiveIndicator in not Visible in Material 3 Bottom Navigation Bar by Default in Android

implementation 'com.google.android.material:material:1.5.0' added this already in Build.Gradle . . Code for implementing Bottom Navigation Bar: <?xml version

Send a path containing slashes in Kotlin Spring mappings

Having trouble dealing with slashes in controller mappings in Kotlin Spring. My client application sends an absolute path ("C:/User/Documents/FolderX"), and sho

Android generated signed APK crash with an error but it's work fine in debug mode

I have a code it's work fine in debug mode also generated signed APK will work fine if isMinifyEnabled=false but for generated signed APK when isMinifyEnabled=t

What magic happens in kotlin

I have kotlin + spring boot app. I done some development in my feature branch committed and returned to dev branch, built app and just tried to start it in inte

Dependency not resolving correctly in ktor kotlin project

My project is having issues correctly resolving my KGraphql dependency when I try to install the feature in my ktor project. How do I go about troubleshooting t

How to make a simple Flutter stopwatch foreground service on Android?

I am implementing a stopwatch (0 to .. seconds counter) in my app. I succesfully implemented it in my Dart code, but I need it to work even if the app is closed

jasync-sql MySQL extra connection parameters

How do I include extra information in the connection url? I looked at the code and it seems that anything after the ? will get thrown out. val connection = MySQ

Kotlin Multiplatform issue : Type 'org.gradle.api.tasks.Copy' property 'sign' doesn't have a configured value

I am trying to build a KMM project everything works fine in Android also in iOS simulator but when I connect an iOS device I get the below error . FAILURE: Buil

Unsatisfied dependency: no bean matches the injection point

I use the Kotlin language to develop Quarkus based application. Regarding to the https://quarkus.io/guides/kotlin it is possible to write constructor injection

MainActivity is not showing log statements

Hi I am new to android development and the problem is Whenever I am using MainActivity in logcat as a filter it is not showing me Log statements for this Log.i

Confused about official Android documentation on Flow

I refer to the official Android documentation on using the Flow library in the recommended app architecture. In the UserRepository class: class UserRepository @

Service info.mqtt.android.service.MqttService has > leaked IntentReceiver

I keep having this error log when ever i toggle off a switch in my app. E/ActivityThread: Service info.mqtt.android.service.MqttService has leaked IntentReceiv

Can't cast okHTTP response as JSON

I am using okhttp 4.9.0 to make API requests, but seems that can't get the response body as JSONOBJECT. This is my code: client.newCall(request).enqueue(object