id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_79935835 | stackoverflow | MOBILE_DEVELOPMENT | Which Android 'background work' feature to use for sending information? | Which Android 'background work' feature to use for sending information?
I am currently developing an Android application with Kotlin and Jetpack Compose that should repeatedly (~once per minute) collect some information about my phone (battery, temperature, current network connection status) and upload that, w... | https://stackoverflow.com/questions/79935835/which-android-background-work-feature-to-use-for-sending-information | android, kotlin, background-process, diagnostics | 1,777,896,737 |
se_79935889 | stackoverflow | MOBILE_DEVELOPMENT | Kotlin / Spring Boot - Logging at Constructor Nullpointer Exceptions | Kotlin / Spring Boot - Logging at Constructor Nullpointer Exceptions
we work with sensitive medical data in our apps. and we want to avoid having them in our logs.
the problem is: if there is a nullpointer exception in object creation, kotlin logs the whole constructor and and thus inadvertently logs the attributes fo... | https://stackoverflow.com/questions/79935889/kotlin-spring-boot-logging-at-constructor-nullpointer-exceptions | spring-boot, kotlin, logging | 1,777,904,090 |
se_79935777 | stackoverflow | MOBILE_DEVELOPMENT | Customizing .m2 folder that is used for Kotlin script | Customizing .m2 folder that is used for Kotlin script
I am using Kotlin script files with @file:Repository and @file:DependsOn to add dependencies.
By default, when the script runs, the dependencies are cached in ~/.m2.
In my CI environment, I want to use a different cache location, for example:
project-root/.m2
so t... | https://stackoverflow.com/questions/79935777/customizing-m2-folder-that-is-used-for-kotlin-script | kotlin, maven, kotlin-script | 1,777,889,505 |
se_79341950 | stackoverflow | MOBILE_DEVELOPMENT | App always uses default theme instead of custom theme | App always uses default theme instead of custom theme
I'm taking a course "Android basics with Jetpack compose" codelab:
Please explain how I should fix my code...
My result:
enter image description here
Desired result:
enter image description here
Colors.kt
package com.example.woof.ui.theme
import androidx.compose.u... | https://stackoverflow.com/questions/79341950/app-always-uses-default-theme-instead-of-custom-theme | kotlin, android-jetpack-compose | 1,736,412,583 |
se_79935081 | stackoverflow | MOBILE_DEVELOPMENT | Why does the error "[ksp] java.lang.IllegalStateException: unexpected jvm signature V" occur when using Room with KSP and how can I solve it? | Why does the error "[ksp] java.lang.IllegalStateException: unexpected jvm signature V" occur when using Room with KSP and how can I solve it?
I am programming a small Counter app where the count should be stored in a Room database. I am using Kotlin, Jetpack Compose and Room Database with KSP. When I try to ... | https://stackoverflow.com/questions/79935081/why-does-the-error-ksp-java-lang-illegalstateexception-unexpected-jvm-signat | android, kotlin, android-room | 1,777,730,587 |
se_49916727 | stackoverflow | MOBILE_DEVELOPMENT | Glide fails to load resources when trying to load an image from a URL | Glide fails to load resources when trying to load an image from a URL
i use glide to load image into Drawable object. When i try to load local image, it works fine. But, i switch to image from url, it won't work and i get this error message :
W/Glide: Load failed for https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_rewa... | https://stackoverflow.com/questions/49916727/glide-fails-to-load-resources-when-trying-to-load-an-image-from-a-url | android, kotlin, android-glide | 1,524,127,909 |
se_79934805 | stackoverflow | MOBILE_DEVELOPMENT | Disabling bottom menu item | Disabling bottom menu item
How do I disable the default backlighting in the bottom navigation? I installed a custom backlight, but I can't remove the default one.
I want to remove the pink highlighting
BottomNavigation code:
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/b... | https://stackoverflow.com/questions/79934805/disabling-bottom-menu-item | xml, kotlin, bottomnavigationview | 1,777,661,587 |
se_79934351 | stackoverflow | MOBILE_DEVELOPMENT | MANAGE_EXTERNAL_STORAGE permission request doesn't show | MANAGE_EXTERNAL_STORAGE permission request doesn't show
I'm asking for the MANAGE_EXTERNAL_STORAGE permission:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
... | https://stackoverflow.com/questions/79934351/manage-external-storage-permission-request-doesnt-show | android, kotlin, android-permissions | 1,777,571,460 |
se_79930717 | stackoverflow | MOBILE_DEVELOPMENT | Pass data to parent in layout phase | Pass data to parent in layout phase
I'm trying to have a parent decide its children's positions based on information about its grandchildren (or other general data), passed upwards by its children.
This should be possible, since the measurement of a composable requires the children's measurement and layouting to be do... | https://stackoverflow.com/questions/79930717/pass-data-to-parent-in-layout-phase | kotlin, android-jetpack-compose, android-jetpack | 1,776,948,203 |
se_79934163 | stackoverflow | MOBILE_DEVELOPMENT | How to import Room into Android Studio correctly? | How to import Room into Android Studio correctly?
I am having problems importing Room into Android Studio correctly. I created a little Counter App, in which the count should be stored in a database. My files for importing Room are:
build.gradle.kts (Project):
plugins {
alias(libs.plugins.android.application)
... | https://stackoverflow.com/questions/79934163/how-to-import-room-into-android-studio-correctly | android, kotlin, android-room | 1,777,546,485 |
se_79933714 | stackoverflow | MOBILE_DEVELOPMENT | Same Room db from Remote Service and Activity | Same Room db from Remote Service and Activity
I wonder if it is okay to use the same Room db in Activity and Remote Service.
Since the Service is remote it resides in a separate process. Is it okay to open the same sqlite db file simultaneously from the Remote Service and the Activity itself? Whether their operations ... | https://stackoverflow.com/questions/79933714/same-room-db-from-remote-service-and-activity | android, kotlin, multiprocessing, android-room, android-service | 1,777,473,723 |
se_79932962 | stackoverflow | MOBILE_DEVELOPMENT | How to add clickable button for code section in for Markdown on Android Compose? | How to add clickable button for code section in for Markdown on Android Compose?
I use a halilibo Composable to render Markdown text:
build.gradle:
implementation 'com.halilibo.compose-richtext:richtext-ui-material3:1.0.0-alpha02'
implementation 'com.halilibo.compose-richtext:richtext-commonmark:1.0.0-alpha02'
My com... | https://stackoverflow.com/questions/79932962/how-to-add-clickable-button-for-code-section-in-for-markdown-on-android-compose | android, kotlin, android-jetpack-compose, richtext, spannablestring | 1,777,367,252 |
se_55448967 | stackoverflow | MOBILE_DEVELOPMENT | How to mock kotlin object for unit testing | How to mock kotlin object for unit testing
I have a sample method(which I need to write test case) as given below,
fun setName(val auxName:String) {
val configUrl = getConfig(auxName)
}
I want to mock the getConfig method and return a specific string value.
getConfig is a method in a Kotlin Object as ... | https://stackoverflow.com/questions/55448967/how-to-mock-kotlin-object-for-unit-testing | unit-testing, kotlin, mockito, powermockito | 1,554,098,912 |
se_79932010 | stackoverflow | MOBILE_DEVELOPMENT | How to get a directory Uri from a DocumentFile for EXTRA_INITIAL_URI? | How to get a directory Uri from a DocumentFile for EXTRA_INITIAL_URI?
My application has user pick a public directory (with Intent.ACTION_OPEN_DOCUMENT_TREE) to make a directory to save files that can be later extracted from the device. I also want to persist the path to the created directory to make it easier to acce... | https://stackoverflow.com/questions/79932010/how-to-get-a-directory-uri-from-a-documentfile-for-extra-initial-uri | android, kotlin, file | 1,777,198,529 |
se_76990341 | stackoverflow | MOBILE_DEVELOPMENT | Android studio gradle task list not build issue | Android studio gradle task list not build issue
I was doing a project on kotlin in android studio. While connecting to firebase, I was going to get the SHA code and write it, but I could not get the SHA code, although they said to turn off a setting on the Internet, it did not work.
I enabled this setting
("Configure... | https://stackoverflow.com/questions/76990341/android-studio-gradle-task-list-not-build-issue | java, android, firebase, kotlin, android-studio | 1,693,202,526 |
se_77870625 | stackoverflow | MOBILE_DEVELOPMENT | I want to rename my app id com.cit.app.cricket to com.cit.app, How can i short app id? | I want to rename my app id com.cit.app.cricket to com.cit.app, How can i short app id?
Refactor didn't work in this case because, this is pre-made project with AppID: com.cit.app.cricket(4 words) but i want com.cit.app(3 words) in my appId. I was change tried change manually by searching the word but it was so difficu... | https://stackoverflow.com/questions/77870625/i-want-to-rename-my-app-id-com-cit-app-cricket-to-com-cit-app-how-can-i-short-a | java, android, firebase, kotlin, android-studio | 1,706,071,915 |
se_75942147 | stackoverflow | MOBILE_DEVELOPMENT | Why is "libs" shown in red from libs.versions.toml used in build.gradle.kts files in android studio Giraffe? | Why is "libs" shown in red from libs.versions.toml used in build.gradle.kts files in android studio Giraffe?
I am using Android Studio Giraffe. In that new recommended way is to use Koltin build instead of groovy. So, when I created the new project, I got both Module and Project level build.gradle.kts files ... | https://stackoverflow.com/questions/75942147/why-is-libs-shown-in-red-from-libs-versions-toml-used-in-build-gradle-kts-file | android, kotlin, gradle-kotlin-dsl, toml | 1,680,713,809 |
se_68919411 | stackoverflow | MOBILE_DEVELOPMENT | AV Pipeline Kit Demo not working, what's the problem? | AV Pipeline Kit Demo not working, what's the problem?
I downloaded the AV Pipeline Kit from here, but it is not working. And don't give any error but the toast message say that need external storage document for working is it require for working with that kit. When I close the control code block this kit not worki... | https://stackoverflow.com/questions/68919411/av-pipeline-kit-demo-not-working-whats-the-problem | java, android, kotlin, huawei-mobile-services, huawei-developers | 1,629,880,121 |
se_60575659 | stackoverflow | MOBILE_DEVELOPMENT | Kotlin Debugging doesn't start in visual studio code | Kotlin Debugging doesn't start in visual studio code
I'm new to Kotlin programming language. so... i have downloaded a few extensions such as Kotlin, Kotlin language,Kotlin Formatter, and when i press F5 it gives an ERROR...just one important question which is, should i use another IDE like intellij ?? because i d... | https://stackoverflow.com/questions/60575659/kotlin-debugging-doesnt-start-in-visual-studio-code | android, visual-studio, debugging, kotlin | 1,583,568,934 |
se_56130893 | stackoverflow | MOBILE_DEVELOPMENT | Kotlin - Converting Float to Double while maintaining precision | Kotlin - Converting Float to Double while maintaining precision
In Kotlin 123.456 is a valid Double value, however, 123.456F.toDouble() results in 123.45600128173828 - presumably just the way precision is handled between the two.
I want to be able to convert freely between the two, specifically for cases like this:
... | https://stackoverflow.com/questions/56130893/kotlin-converting-float-to-double-while-maintaining-precision | kotlin, floating-point | 1,557,838,109 |
se_68882840 | stackoverflow | MOBILE_DEVELOPMENT | Kotlin spring controller integration test not working | Kotlin spring controller integration test not working
I'm struggling here, I have been stuck on this for about a week now, don't know how to get this working. I am trying to write a integration test to check if my introduced spring variable validation in my controller is working, but I am running into issues on how to... | https://stackoverflow.com/questions/68882840/kotlin-spring-controller-integration-test-not-working | spring, kotlin, spring-mvc, spring-security, integration-testing | 1,629,646,934 |
se_49261712 | stackoverflow | MOBILE_DEVELOPMENT | How to mock objects in Kotlin? | How to mock objects in Kotlin?
I want to test a class that calls an object (static method call in java) but I'm not able to mock this object to avoid real method to be executed.
object Foo {
fun bar() {
//Calls third party sdk here
}
}
I've tried different options like Mockk, How to mock a Kotlin si... | https://stackoverflow.com/questions/49261712/how-to-mock-objects-in-kotlin | android, unit-testing, kotlin, mockito, powermockito | 1,520,960,027 |
se_79927293 | stackoverflow | MOBILE_DEVELOPMENT | Camera2 + MediaRecorder: How to crop recorded video to match preview (portrait WYSIWYG) on Android (Rockchip device)? | Camera2 + MediaRecorder: How to crop recorded video to match preview (portrait WYSIWYG) on Android (Rockchip device)?
I am building an Android app using Camera2 API + MediaRecorder where the device is locked in portrait mode (kiosk mode).
Problem
The camera preview looks correct (portrait, 9:16), but the recorded vide... | https://stackoverflow.com/questions/79927293/camera2-mediarecorder-how-to-crop-recorded-video-to-match-preview-portrait-w | java, kotlin, android-camera2, android-camerax, android-media3 | 1,776,420,446 |
se_79929541 | stackoverflow | MOBILE_DEVELOPMENT | PowerSync: How to serialize data for crud upload | PowerSync: How to serialize data for crud upload
I'm connecting a mobile app to Supabase via Powersync. I managed to log in and even upload some data. But now whenever I create new data or update data on the client side (the device), it is not uploaded to Supabase and I get the following error:
Error uploading crud: ... | https://stackoverflow.com/questions/79929541/powersync-how-to-serialize-data-for-crud-upload | kotlin | 1,776,783,372 |
se_37977320 | stackoverflow | MOBILE_DEVELOPMENT | How to mock a Kotlin singleton object? | How to mock a Kotlin singleton object?
Given a Kotlin singleton object and a fun that call it's method
object SomeObject {
fun someFun() {}
}
fun callerFun() {
SomeObject.someFun()
}
Is there a way to mock call to SomeObject.someFun()? | https://stackoverflow.com/questions/37977320/how-to-mock-a-kotlin-singleton-object | mocking, mockito, kotlin, powermock, powermockito | 1,466,626,057 |
se_66113448 | stackoverflow | MOBILE_DEVELOPMENT | Kotlin Multiplatform Mobile unable to run on iOS: Execution failed for task ':shared:compileKotlinIosX64' | Kotlin Multiplatform Mobile unable to run on iOS: Execution failed for task ':shared:compileKotlinIosX64'
I have created fresh project(Hello World) in KMM followed by their official website. In android it works smooth but when I am trying to run in XCode it's giving errors because of which I am unable to build... | https://stackoverflow.com/questions/66113448/kotlin-multiplatform-mobile-unable-to-run-on-ios-execution-failed-for-task-sh | ios, xcode, kotlin, kotlin-multiplatform | 1,612,848,258 |
se_78241982 | stackoverflow | MOBILE_DEVELOPMENT | Quarkus Qute Kotlin index page is displaying io.quarkus.qute.runtime.TemplateProducer$InjectableTemplate$InjectableTemplateInstanceImp | Quarkus Qute Kotlin index page is displaying io.quarkus.qute.runtime.TemplateProducer$InjectableTemplate$InjectableTemplateInstanceImp
I am using latest version of Quarkus with Kotlin and Qute.
I am trying to run my index page and when I call the page in browser I am keep getting white page with the below message. Loo... | https://stackoverflow.com/questions/78241982/quarkus-qute-kotlin-index-page-is-displaying-io-quarkus-qute-runtime-templatepro | kotlin, quarkus | 1,711,686,215 |
se_79928009 | stackoverflow | MOBILE_DEVELOPMENT | PowerSyncException: get() called with query that returned no rows | PowerSyncException: get() called with query that returned no rows
I'm connecting PowerSync to an Android app. Upon launching the app I get the:
PowerSyncException: get() called with query that returned no rows
error. That's all it gives me, it doesn't point to a specific file or a method. I suppose this error will r... | https://stackoverflow.com/questions/79928009/powersyncexception-get-called-with-query-that-returned-no-rows | kotlin | 1,776,530,351 |
se_79250724 | stackoverflow | MOBILE_DEVELOPMENT | Error: The DROP_SHADER_CACHE broadcast was not received when adding Baseline Profile in Android App | Error: The DROP_SHADER_CACHE broadcast was not received when adding Baseline Profile in Android App
I am trying to add a baseline profile for an Android app. I have primarily used the Google Android documentation and [this video][https://youtu.be/m7oRRdud-mY?si=0vrqtY5pYg-61Fue] to create a new benchmark module and as... | https://stackoverflow.com/questions/79250724/error-the-drop-shader-cache-broadcast-was-not-received-when-adding-baseline-pro | android, performance, kotlin, baseline-profile | 1,733,307,476 |
se_70847513 | stackoverflow | MOBILE_DEVELOPMENT | When and how to use Result in Kotlin? | When and how to use Result in Kotlin?
I love the idea of Result.
I love having encapsulated try/catch.
But I’m a little confused about how and when to use Result.
I currently use it like this:
My adapters and services return a Result. Failures and stacktraces are logged but do nothing else
runCatching{
.... // do ... | https://stackoverflow.com/questions/70847513/when-and-how-to-use-result-in-kotlin | kotlin | 1,643,108,521 |
se_79926738 | stackoverflow | MOBILE_DEVELOPMENT | KMP Windows Run Failed with Navigation3 | KMP Windows Run Failed with Navigation3
Code as below:
First Screen:
@Composable
fun FirstScreen() {
Column(
modifier = Modifier.fillMaxSize()
) {
Toolbar()
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun Toolbar() {
TopAppBar(
title = { Text("First") },
... | https://stackoverflow.com/questions/79926738/kmp-windows-run-failed-with-navigation3 | windows, kotlin, android-jetpack-compose, kotlin-multiplatform | 1,776,351,979 |
se_79926627 | stackoverflow | MOBILE_DEVELOPMENT | Optional Koin injection parameter | Optional Koin injection parameter
I could not find any good solution online, so I will post what I found to work here.
In order to have an optional parameter for Koin injections you can use the following code:
val someModule: Module = module {
factory<SomeClass> { (type: SomeEnum) ->
when(type) {
... | https://stackoverflow.com/questions/79926627/optional-koin-injection-parameter | kotlin, dependency-injection, koin | 1,776,341,149 |
se_79926109 | stackoverflow | MOBILE_DEVELOPMENT | How to instantiate a connected PowerSyncDatabase by calling a suspend function inside a synchronized block? | How to instantiate a connected PowerSyncDatabase by calling a suspend function inside a synchronized block?
I'm trying to create a singleton to return an instance of a PowerSyncDatabase.
class OnlineSyncDatabase {
companion object {
// @Volatile
private val instance: PowerSyncDatabase? = null
... | https://stackoverflow.com/questions/79926109/how-to-instantiate-a-connected-powersyncdatabase-by-calling-a-suspend-function-i | kotlin, singleton, kotlin-coroutines | 1,776,264,651 |
se_79913713 | stackoverflow | MOBILE_DEVELOPMENT | How to convert an API response into a Kotlin Flow | How to convert an API response into a Kotlin Flow
I'm connecting my ViewModel to the Supabase CRUD methods. I have defined:
a sealed class to hold the API response:
sealed class ApiResponse<out R> {
data class Success<out R>(val data: R) : ApiResponse<R>()
data class Error(val message: String?) : ApiResponse<... | https://stackoverflow.com/questions/79913713/how-to-convert-an-api-response-into-a-kotlin-flow | kotlin, kotlin-flow | 1,774,372,910 |
se_67699823 | stackoverflow | MOBILE_DEVELOPMENT | Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15 | Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15
In Stripe, my client wants email and cardholder name, but the Stripe payment UI doesn't provide that option in com.stripe.android.view.CardMultilineWidget. I wanted to give it a try with ... | https://stackoverflow.com/questions/67699823/module-was-compiled-with-an-incompatible-version-of-kotlin-the-binary-version-o | android, flutter, kotlin, gradle, stripe-payments | 1,622,011,507 |
se_79923889 | stackoverflow | MOBILE_DEVELOPMENT | Is `This argument is a new instance so stopService will not remove anything` valid for `stopService(Intent(...))`, or is it a false positive? | Is `This argument is a new instance so stopService will not remove anything` valid for `stopService(Intent(...))`, or is it a false positive?
When I run Inspect Code in a specific version of Android Studio, I get a warning for the following code in MainActivity, specifically at the point where the Intent is created:
s... | https://stackoverflow.com/questions/79923889/is-this-argument-is-a-new-instance-so-stopservice-will-not-remove-anything-val | android, kotlin, lint, code-inspection | 1,775,888,323 |
se_67898182 | stackoverflow | MOBILE_DEVELOPMENT | How to share a temporary file with the Share Sheet? | How to share a temporary file with the Share Sheet?
I have a database, in this one I store small text notes.
I want to let the user select the notes that they want from a recyclerview (I already have this implemented) and if they press the share button, the app should create a temporary file just for sharing and that ... | https://stackoverflow.com/questions/67898182/how-to-share-a-temporary-file-with-the-share-sheet | android, kotlin | 1,623,217,085 |
se_79924721 | stackoverflow | MOBILE_DEVELOPMENT | MediaMetadataRetriever fails after 102 requests with exception 0x80000000 | MediaMetadataRetriever fails after 102 requests with exception 0x80000000
I want to check if each of my mp3 files has a valid picture that the Android system can read.
For this I iterate over all the items in the MediaStore.Audio.Media and then ask the MediaMetadataRetriever to .setDataSource() to .getEmbeddedPicture(... | https://stackoverflow.com/questions/79924721/mediametadataretriever-fails-after-102-requests-with-exception-0x80000000 | android, kotlin, mediametadataretriever | 1,776,077,415 |
se_79924686 | stackoverflow | MOBILE_DEVELOPMENT | How to provide a PowerSync database instance via Hilt | How to provide a PowerSync database instance via Hilt
I have a Hilt module that is supposed to provide a PowerSync database instance, which is then injected into ActivitydataSource, and the ActivityDataSource is injected into ActivitiesRepository.
import android.content.Context
...
import com.powersync.DatabaseDriverF... | https://stackoverflow.com/questions/79924686/how-to-provide-a-powersync-database-instance-via-hilt | kotlin, dagger-hilt, suspend | 1,776,072,369 |
se_69743773 | stackoverflow | MOBILE_DEVELOPMENT | Usage of curly brackets at the end of function call kotlin | Usage of curly brackets at the end of function call kotlin
What does it change between these two calls? I tried and they have the same behaviour
unsortedInputValues.joinToString(","){it}
unsortedInputValues.joinToString(",") | https://stackoverflow.com/questions/69743773/usage-of-curly-brackets-at-the-end-of-function-call-kotlin | kotlin | 1,635,359,434 |
se_78506430 | stackoverflow | MOBILE_DEVELOPMENT | The application could not be installed. Installation failed due to: 'Error code: 'UNKNOWN', message='Unknown failure: '[CDS]close[0] | The application could not be installed. Installation failed due to: 'Error code: 'UNKNOWN', message='Unknown failure: '[CDS]close[0]
I'm building an Android app with Android Studio but I'm using a physical device, when I build and run on older Androids like 5.0, I get this error:
But it works on n... | https://stackoverflow.com/questions/78506430/the-application-could-not-be-installed-installation-failed-due-to-error-code | java, android, kotlin, mobile-development | 1,716,205,906 |
se_79923291 | stackoverflow | MOBILE_DEVELOPMENT | AppCompatDelegate.setApplicationLocales() restarts activity when switching from system default to any other language despite configuration handling | AppCompatDelegate.setApplicationLocales() restarts activity when switching from system default to any other language despite configuration handling
Similar unresolved issues:
Android restarts activity although locales configuration changes are handled by app
Activity recreating on first locale change
My activity has `... | https://stackoverflow.com/questions/79923291/appcompatdelegate-setapplicationlocales-restarts-activity-when-switching-from | android, kotlin | 1,775,797,568 |
se_79919683 | stackoverflow | MOBILE_DEVELOPMENT | How to handle API response in a ViewModel | How to handle API response in a ViewModel
I'm connecting a mobile app to Supabase CRUD methods. After making a call to the Supabase database I receive a flow of ApiResponse<>:
sealed class ApiResponse<out R> {
data class Success<out R>(val data: R): ApiResponse<R>()
data class Error(val message: String?): ApiR... | https://stackoverflow.com/questions/79919683/how-to-handle-api-response-in-a-viewmodel | kotlin, kotlin-flow | 1,775,227,101 |
se_68956792 | stackoverflow | MOBILE_DEVELOPMENT | Floating toolbar for text selection Jetpack Compose | Floating toolbar for text selection Jetpack Compose
How can I customize a menu for selected text to a TextField in Jetpack Compose? I mean something like this:
Didn't find anything in the official documentation or on the Internet about how to do this using Jetpack Compose. | https://stackoverflow.com/questions/68956792/floating-toolbar-for-text-selection-jetpack-compose | android, kotlin, android-jetpack, android-jetpack-compose | 1,630,082,242 |
se_77157136 | stackoverflow | MOBILE_DEVELOPMENT | Why are the images in my inner Rows not getting displayed at the center in jetpack compose? | Why are the images in my inner Rows not getting displayed at the center in jetpack compose?
I have a parent Row and inner Rows, each inner Row contains an Image, so I want them to get displayed at the center side by side. Currently I have even given horizontalArrangement as Center but still it's not getting displayed ... | https://stackoverflow.com/questions/77157136/why-are-the-images-in-my-inner-rows-not-getting-displayed-at-the-center-in-jetpa | android, kotlin, android-jetpack-compose | 1,695,381,305 |
se_55182578 | stackoverflow | MOBILE_DEVELOPMENT | How to read plain text file in kotlin? | How to read plain text file in kotlin?
There may be various way to read plain text file in kotlin.
I want know what are the possible ways and how I can use them. | https://stackoverflow.com/questions/55182578/how-to-read-plain-text-file-in-kotlin | file, kotlin, text-files, bufferedreader | 1,552,652,738 |
se_78809435 | stackoverflow | MOBILE_DEVELOPMENT | Kmp Kotlin 2.0 with Ksp Koin Annotations doesn't find generated modules on iOS | Kmp Kotlin 2.0 with Ksp Koin Annotations doesn't find generated modules on iOS
After migration Kmp project from Kotlin 1.9.24 to 2.0.0 and updating ksp from 1.9.24-1.0.20 to 2.0.0-1.0.24, Android build works but iOS doesn't compile because it can't find generated Koin modules... the same error exists for all ksp 2... | https://stackoverflow.com/questions/78809435/kmp-kotlin-2-0-with-ksp-koin-annotations-doesnt-find-generated-modules-on-ios | kotlin, kotlin-multiplatform, koin, android-koin, compose-multiplatform-ios | 1,722,300,417 |
se_79922479 | stackoverflow | MOBILE_DEVELOPMENT | Unresolved reference 'await' and 'user' in Firebase Auth (Kotlin Multiplatform / AndroidMain) | Unresolved reference 'await' and 'user' in Firebase Auth (Kotlin Multiplatform / AndroidMain)
I'm working on a Kotlin Multiplatform (KMP) project and I'm trying to implement a Firebase Authentication DataSource inside androidMain. Even after adding the Firebase dependencies, the compiler cannot resolve... | https://stackoverflow.com/questions/79922479/unresolved-reference-await-and-user-in-firebase-auth-kotlin-multiplatform | android, firebase, kotlin, firebase-authentication, kotlin-coroutines | 1,775,684,605 |
se_79922181 | stackoverflow | MOBILE_DEVELOPMENT | Ways to hint the compiler about return type when calling generic function | Ways to hint the compiler about return type when calling generic function
A nice generic function I use to call python functions in another process, using Json....
inline fun<reified Tin0, reified Tin1, reified Tout> callPy2(
methodName:String, input0: Tin0, input1: Tin1
) : Tout {
// For demonstration only. T... | https://stackoverflow.com/questions/79922181/ways-to-hint-the-compiler-about-return-type-when-calling-generic-function | kotlin, generics | 1,775,648,664 |
se_79129652 | stackoverflow | MOBILE_DEVELOPMENT | Change the default Google Maps background for tiles that are not loaded yet? | Change the default Google Maps background for tiles that are not loaded yet?
At the moment, I am creating an app with Jetpack Compose that uses the Google Maps SDK (https://github.com/googlemaps/android-maps-compose). When you move the map fast and the tiles are not loaded yet, you see the default background of the c... | https://stackoverflow.com/questions/79129652/change-the-default-google-maps-background-for-tiles-that-are-not-loaded-yet | android, kotlin, google-maps, android-jetpack-compose | 1,729,985,418 |
se_73473258 | stackoverflow | MOBILE_DEVELOPMENT | How can I disable the Android 11's auto-reset permissions in android application? | How can I disable the Android 11's auto-reset permissions in android application?
Since Android 11, there has been a system feature where it resets app permissions after a certain amount of time has passed and you haven't used the app.
I know you can turn it off on most apps, by the user itself like the screenshot... | https://stackoverflow.com/questions/73473258/how-can-i-disable-the-android-11s-auto-reset-permissions-in-android-application | java, android, android-studio, kotlin, android-permissions | 1,661,344,439 |
se_71950568 | stackoverflow | MOBILE_DEVELOPMENT | Use OpenCV in a Kotlin Multiplatform Mobile(KMM) project | Use OpenCV in a Kotlin Multiplatform Mobile(KMM) project
Setup:
We are currently using OpenCV on iOS and Android for image processing. On Android we import OpenCV as a .aar and on iOS we import it via Cocoapods, and they call the same underlying functions.
Problem:
We would like to have a KMM project where we can impo... | https://stackoverflow.com/questions/71950568/use-opencv-in-a-kotlin-multiplatform-mobilekmm-project | ios, kotlin, opencv, kotlin-multiplatform | 1,650,526,565 |
se_78846594 | stackoverflow | MOBILE_DEVELOPMENT | Error running 'app' Unexpected end of asynchronous channel | Error running 'app' Unexpected end of asynchronous channel
Tried building a sample app in Android Studio and got the following error
Error running 'app'
Unexpected end of asynchronous channel
I tried both in the simulator and phone through a USB Cable.
I have followed this Answer but still getting this erro... | https://stackoverflow.com/questions/78846594/error-running-app-unexpected-end-of-asynchronous-channel | android, kotlin, android-studio | 1,723,093,477 |
se_79920119 | stackoverflow | MOBILE_DEVELOPMENT | Migrate single { lambda } to Koin Compiler | Migrate single { lambda } to Koin Compiler
I am currently migrating an Android project that previously used Koin without the Koin Compiler Plugin, and I now want to adopt the plugin correctly.
I am unsure how to handle this part of the migration:
val databaseModule = module {
// ...
single { get<AppDatabase>()... | https://stackoverflow.com/questions/79920119/migrate-single-lambda-to-koin-compiler | android, kotlin, koin, android-koin | 1,775,309,075 |
se_71457615 | stackoverflow | MOBILE_DEVELOPMENT | meow bottom navigation bar is not recogonised by android studio even after entering dependencies? | meow bottom navigation bar is not recogonised by android studio even after entering dependencies?
it giving me error <meow.meowbottomnavigation.MeowBottomNavigation
/>
in red, saying missing class even after entering these dependecies.
build.gradel(project)
buildscript {
repositories {
jcenter()
}
}
pl... | https://stackoverflow.com/questions/71457615/meow-bottom-navigation-bar-is-not-recogonised-by-android-studio-even-after-enter | android, android-studio, kotlin, android-layout, android-bottomnav | 1,647,181,046 |
se_78008527 | stackoverflow | MOBILE_DEVELOPMENT | Unresolved reference kapt and ksp in Android Studio when trying to do the setup for the use of ROOM local database | Unresolved reference kapt and ksp in Android Studio when trying to do the setup for the use of ROOM local database
I've recently started to learn programming in Android Studio Kotlin and after going through some tutorials on Kotlin language and creating a User Interface in Android Studio, I decided to start learning a... | https://stackoverflow.com/questions/78008527/unresolved-reference-kapt-and-ksp-in-android-studio-when-trying-to-do-the-setup | android, kotlin, android-studio, android-room, kapt | 1,708,098,552 |
se_70053308 | stackoverflow | MOBILE_DEVELOPMENT | Jetpack compose preview crashes with hiltViewModel<>() | Jetpack compose preview crashes with hiltViewModel<>()
I use compose version 1.1.0-beta03 and hilt-navigation-compose:1.0.0-beta01.
this is my Composable code:
fun EngagementBotChart(modifier: Modifier = Modifier) {
val newHomeViewModel = hiltViewModel<HomeViewModel>()
AndroidView(
modifier = mod... | https://stackoverflow.com/questions/70053308/jetpack-compose-preview-crashes-with-hiltviewmodel | android, kotlin, android-jetpack-compose, dagger-hilt | 1,637,487,336 |
se_79606387 | stackoverflow | MOBILE_DEVELOPMENT | Undefined symbols for architecture arm64: "_kfun:androidx.lifecycle.viewmodel.compose | Undefined symbols for architecture arm64: "_kfun:androidx.lifecycle.viewmodel.compose
I'm facing an issue when building the iOS app for KMP
Undefined symbols for architecture arm64: "_kfun:androidx.lifecycle.viewmodel.compose#androidx_lifecycle_viewmodel_compose_LocalViewModelStoreOwner$stableprop_getter$artifici... | https://stackoverflow.com/questions/79606387/undefined-symbols-for-architecture-arm64-kfunandroidx-lifecycle-viewmodel-co | android, ios, kotlin, android-jetpack-compose, kmp | 1,746,424,723 |
se_79917293 | stackoverflow | MOBILE_DEVELOPMENT | How to make sure users read and modify only their own data in Supabase? | How to make sure users read and modify only their own data in Supabase?
I'm connecting an Android app to Supabase. The Supabase project includes users and tasks tables. I would like to allow users to read, update and delete their own tasks only. From what I understand, the Supabase documentation states that applying a... | https://stackoverflow.com/questions/79917293/how-to-make-sure-users-read-and-modify-only-their-own-data-in-supabase | kotlin, supabase | 1,774,893,953 |
se_76013858 | stackoverflow | MOBILE_DEVELOPMENT | Octane SDK (impinj RFID reader) fails to save settings | Octane SDK (impinj RFID reader) fails to save settings
I got Speedway R420 RFID reader. Trying to read tags. It does work on a real model connected to emulator or real Android device, but during field test it fails. Studying logs I managed to clarify that it fails during simple enough operation. Here's draft code:
val... | https://stackoverflow.com/questions/76013858/octane-sdk-impinj-rfid-reader-fails-to-save-settings | java, kotlin, rfid | 1,681,466,366 |
se_79917788 | stackoverflow | MOBILE_DEVELOPMENT | Best practices for DTO mapping in jOOQ 3.20 + Kotlin Spring boot Web Apps | Best practices for DTO mapping in jOOQ 3.20 + Kotlin Spring boot Web Apps
I recently started using jOOQ, and I absolutely love it. I really appreciate how intuitive it is writing jOOQ code feels exactly like writing raw MySQL
However, as a beginner, I’m struggling to find the "recommended" architecture for my specific... | https://stackoverflow.com/questions/79917788/best-practices-for-dto-mapping-in-jooq-3-20-kotlin-spring-boot-web-apps | spring, spring-boot, kotlin, jooq | 1,774,962,361 |
se_79917670 | stackoverflow | MOBILE_DEVELOPMENT | TextAlign.Justify only works on the emulator, not on a physical device | TextAlign.Justify only works on the emulator, not on a physical device
why are all the lines (not just the last line of the paragraph) aligned to the left on a real device, while on a virtual device they are aligned to the width of the screen except for the last one (as they should be), why are they not aligned to the... | https://stackoverflow.com/questions/79917670/textalign-justify-only-works-on-the-emulator-not-on-a-physical-device | android, kotlin, android-studio, android-jetpack-compose | 1,774,950,161 |
se_79913208 | stackoverflow | MOBILE_DEVELOPMENT | YouTube embedded playback in Android Kotlin app fails with error 152-4 even though onReady fires Body | YouTube embedded playback in Android Kotlin app fails with error 152-4 even though onReady fires Body
I am building an Android education app in Kotlin where lessons are organized by course, grade, and chapter, and videos are played from YouTube.
To isolate the issue, I created a fresh minimal Android test app. There i... | https://stackoverflow.com/questions/79913208/youtube-embedded-playback-in-android-kotlin-app-fails-with-error-152-4-even-thou | android, kotlin, webview, youtube-api, youtube-iframe-api | 1,774,327,543 |
se_69527813 | stackoverflow | MOBILE_DEVELOPMENT | Spring Kafka: UnknownHostException: 34bcfcc207e0 | Spring Kafka: UnknownHostException: 34bcfcc207e0
I wrote kafka producer / consumer for my app:
Consumer config:
@EnableKafka
@Configuration
class KafkaConsumerConfig {
@Bean
fun consumerFactory(): ConsumerFactory<String, String> {
val props: MutableMap<String, Any> = HashMap()
props[ConsumerCo... | https://stackoverflow.com/questions/69527813/spring-kafka-unknownhostexception-34bcfcc207e0 | java, kotlin, apache-kafka, spring-kafka | 1,633,962,236 |
se_79914026 | stackoverflow | MOBILE_DEVELOPMENT | In Android with Kotlin, is there any way to create a custom element with XML that can contain a child in a specific place? | In Android with Kotlin, is there any way to create a custom element with XML that can contain a child in a specific place?
I’ve been trying to create a custom CardView with a title and below the title any type of content, but, when I try overriding addView in the Kotlin class of the custom element to redirect the chil... | https://stackoverflow.com/questions/79914026/in-android-with-kotlin-is-there-any-way-to-create-a-custom-element-with-xml-tha | android, kotlin, android-layout | 1,774,418,988 |
se_79569118 | stackoverflow | MOBILE_DEVELOPMENT | Android 14: MediaProjection Screen Capture Permission Requested Repeatedly Despite Previous Grant | Android 14: MediaProjection Screen Capture Permission Requested Repeatedly Despite Previous Grant
I'm developing an Android application that uses MediaProjection to capture the screen. My app works as expected on Android 11, where the screen capture permission is requested once and then persists across multiple captur... | https://stackoverflow.com/questions/79569118/android-14-mediaprojection-screen-capture-permission-requested-repeatedly-despi | android, kotlin, android-studio, screenshot, screen-capture | 1,744,382,817 |
se_79913891 | stackoverflow | MOBILE_DEVELOPMENT | How to properly compress images for recycler view | How to properly compress images for recycler view
I have a recycler view displaying multiple images\details from a SQL DB. I have tossed a few ideas back and forth about how to best display the images but I've run into a couple issues.
Initially I just took pictures via the phones camera, saved those to the filesdir a... | https://stackoverflow.com/questions/79913891/how-to-properly-compress-images-for-recycler-view | android, kotlin, bitmap, uri | 1,774,394,320 |
se_79911925 | stackoverflow | MOBILE_DEVELOPMENT | ComposePausableCompositionException and IllegalStateException: Apply is called on deactivated node when fast scrolling LazyColumn with Coil AsyncImage | ComposePausableCompositionException and IllegalStateException: Apply is called on deactivated node when fast scrolling LazyColumn with Coil AsyncImage
Hello everyone,
I am experiencing a persistent crash in my Jetpack Compose project while using Coil (AsyncImage) inside a LazyColumn. The data is being observed from a ... | https://stackoverflow.com/questions/79911925/composepausablecompositionexception-and-illegalstateexception-apply-is-called-o | android, kotlin, android-jetpack-compose, android-jetpack-compose-lazy-column | 1,774,103,729 |
se_79916245 | stackoverflow | MOBILE_DEVELOPMENT | Spring Boot OAuth2ResourceServer Excluding Paths (Cloudflare Turnstile) | Spring Boot OAuth2ResourceServer Excluding Paths (Cloudflare Turnstile)
I have a Spring Boot REST API written in Kotlin using Keycloak with Spring Security for authentication and authorization. I want to expose one endpoint publicly but protect it with Cloudflare Turnstile to prevent bots.
I implemented a custom OnceP... | https://stackoverflow.com/questions/79916245/spring-boot-oauth2resourceserver-excluding-paths-cloudflare-turnstile | spring, spring-boot, kotlin, spring-mvc, spring-security | 1,774,710,117 |
se_79911605 | stackoverflow | MOBILE_DEVELOPMENT | How to import Mockk dependency in Kotlin class | How to import Mockk dependency in Kotlin class
I just downloaded a demo project from start.spring.io
In pom.xml I changed the kotlin version to 2.2.0 and added `io.mockk` dependency.
But in the code I am not able to import it. Even though I see the dependency in classpath. why?
pom.xml:
<?xml version="1.0" encoding="... | https://stackoverflow.com/questions/79911605/how-to-import-mockk-dependency-in-kotlin-class | spring-boot, kotlin, maven, mockk | 1,774,038,098 |
se_76359300 | stackoverflow | MOBILE_DEVELOPMENT | How can I set OutlinedTextField content to vertically center in jetpack compose? | How can I set OutlinedTextField content to vertically center in jetpack compose?
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun OutlinedTextField(
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
readOnly: Boolean = false,
textStyle... | https://stackoverflow.com/questions/76359300/how-can-i-set-outlinedtextfield-content-to-vertically-center-in-jetpack-compose | android, kotlin, android-jetpack-compose | 1,685,381,585 |
se_78492004 | stackoverflow | MOBILE_DEVELOPMENT | Android Studio. Gradle Sync error: Could not move temporary workspace | Android Studio. Gradle Sync error: Could not move temporary workspace
I am making a new project in Android Studio, but I have a problem when it is syncing gradle for the first time and I can't do anymore.
I get these error messages:
FAILURE: Build failed with an exception.
* What went wrong:
java.io.UncheckedIOExcept... | https://stackoverflow.com/questions/78492004/android-studio-gradle-sync-error-could-not-move-temporary-workspace | android, kotlin, android-studio, gradle, android-jetpack-compose | 1,715,886,474 |
se_79253432 | stackoverflow | MOBILE_DEVELOPMENT | How to create a sticky header and reversed message order in Jetpack Compose LazyColumn? | How to create a sticky header and reversed message order in Jetpack Compose LazyColumn?
I am working on a chat app using Jetpack Compose and trying to implement the following:
Sticky Header: I want to display a sticky header at the top of the LazyColumn, which contains information like "End-to-End Encryption Enabled"... | https://stackoverflow.com/questions/79253432/how-to-create-a-sticky-header-and-reversed-message-order-in-jetpack-compose-lazy | android, kotlin, android-jetpack-compose | 1,733,373,992 |
se_79911449 | stackoverflow | MOBILE_DEVELOPMENT | Convert PEM-encoded RSA public key back to AsymmetricKeyParameter with Kotlin | Convert PEM-encoded RSA public key back to AsymmetricKeyParameter with Kotlin
I need to send public keys generated with Bouncy Castle as strings and I'm trying now to figure out how to convert the encoded strings back to the original key.
Generating the key pair:
fun generateKeyPair(): AsymmetricCipherKeyPair {
va... | https://stackoverflow.com/questions/79911449/convert-pem-encoded-rsa-public-key-back-to-asymmetrickeyparameter-with-kotlin | kotlin, rsa, bouncycastle | 1,774,021,331 |
se_79903535 | stackoverflow | MOBILE_DEVELOPMENT | How can I improve unit tests for Repository pattern with Room and Retrofit in Android? | How can I improve unit tests for Repository pattern with Room and Retrofit in Android?
I am writing unit tests for my Android MVVM app.
The repository fetches users from an API and stores them in a Room database.
If the API fails, it loads cached users from the database.
I wrote the following unit tests to verify:
1. ... | https://stackoverflow.com/questions/79903535/how-can-i-improve-unit-tests-for-repository-pattern-with-room-and-retrofit-in-an | kotlin, android-jetpack-compose | 1,773,018,035 |
se_79826201 | stackoverflow | MOBILE_DEVELOPMENT | Testing with corroutines | Testing with corroutines
Let's say I have Worker class and I want to do long running tasks in the background until user stops it or it is cancelled. It changes state of the class while doing the work and I want to write tests how work progresses with each loop. For this example I want to check loopCounter value after ... | https://stackoverflow.com/questions/79826201/testing-with-corroutines | kotlin, unit-testing, testing, kotlin-coroutines | 1,763,706,944 |
se_79912657 | stackoverflow | MOBILE_DEVELOPMENT | Android: Cannot use AudioRecord and SpeechRecognizer together (microphone conflict) but works on iOS | Android: Cannot use AudioRecord and SpeechRecognizer together (microphone conflict) but works on iOS
I am building a Flutter app with native Android code where I:
Record audio using AudioRecord
Perform speech-to-text using Vosk (offline recognition)
This works fine individually, but when I try to:
Record audio AN... | https://stackoverflow.com/questions/79912657/android-cannot-use-audiorecord-and-speechrecognizer-together-microphone-confli | android, flutter, kotlin, speech-recognition, audio-recording | 1,774,256,277 |
se_79912369 | stackoverflow | MOBILE_DEVELOPMENT | Why does accessing DataStore's Flows block indefinitely? | Why does accessing DataStore's Flows block indefinitely?
I am developing an app that's primary function is to talk to a web server when the user presses a button and then intermittently in the background while the app may be closed. I'm currently trying to figure out how to save the cookies in a way that will pers... | https://stackoverflow.com/questions/79912369/why-does-accessing-datastores-flows-block-indefinitely | android, kotlin, kotlin-flow, android-jetpack-datastore | 1,774,197,787 |
se_77599239 | stackoverflow | MOBILE_DEVELOPMENT | I' Am getting appRecognitionVerdict as UNRECOGNIZED_VERSION in play Integrity Standard API Request for normal device | I' Am getting appRecognitionVerdict as UNRECOGNIZED_VERSION in play Integrity Standard API Request for normal device
Currently getting this response from the API.
{"tokenPayloadExternal":{"accountDetails":{"appLicensingVerdict":"LICENSED"},"appIntegrity":{"appRecognitionVerdict":"UNRECOGNIZED_VERSION","certificate... | https://stackoverflow.com/questions/77599239/i-am-getting-apprecognitionverdict-as-unrecognized-version-in-play-integrity-st | android, kotlin, google-api-client, google-play-integrity-api | 1,701,690,949 |
se_79912408 | stackoverflow | MOBILE_DEVELOPMENT | How to access a repository from a Worker created by a Broadcast Receiver? | How to access a repository from a Worker created by a Broadcast Receiver?
I have a repository I create in the onCreate method of my application class. I also have a manifest-declared Broadcast Receiver which creates a Coroutine Worker which I would like to call a method from the repository. How can I access the instan... | https://stackoverflow.com/questions/79912408/how-to-access-a-repository-from-a-worker-created-by-a-broadcast-receiver | android, kotlin, broadcastreceiver, android-context, android-workmanager | 1,774,203,435 |
se_78865341 | stackoverflow | MOBILE_DEVELOPMENT | Combine flows but always wait for one to emit | Combine flows but always wait for one to emit
I have 3 source kotlin flows that are periodically emitting values. I have one collector that collects 2 of these flows by combining and calculating a certain value. This calculated value is also emitted in a separate intermediate flow. Something like the following:
val in... | https://stackoverflow.com/questions/78865341/combine-flows-but-always-wait-for-one-to-emit | kotlin, kotlin-coroutines, kotlin-flow | 1,723,540,121 |
se_79877755 | stackoverflow | MOBILE_DEVELOPMENT | Error "Unable to load class 'com.android.build.api.artifact.ScopedArtifact$POST_COMPILATION_CLASSES'" after adding Hilt | Error "Unable to load class 'com.android.build.api.artifact.ScopedArtifact$POST_COMPILATION_CLASSES'" after adding Hilt
I am new to native android development. I find it hard to add dependencies of room, hilt because of shift to KSP. How to solve my error while adding these? AI is complicating it.
Wh... | https://stackoverflow.com/questions/79877755/error-unable-to-load-class-com-android-build-api-artifact-scopedartifactpost | android, kotlin, android-gradle-plugin, build.gradle, dagger-hilt | 1,769,589,677 |
se_52014833 | stackoverflow | MOBILE_DEVELOPMENT | How do i download file with Service | How do i download file with Service
My goal is to download files with a Service (please, you may suggest a better option) in the background without having to interact with the app such that a download can be triggered (startService) whenever it receives a broadcast that a new text has been copied to clipboard and the ... | https://stackoverflow.com/questions/52014833/how-do-i-download-file-with-service | android, kotlin, android-service, android-file, android-download-manager | 1,535,180,486 |
se_79911503 | stackoverflow | MOBILE_DEVELOPMENT | How to get '/storage/emulated/0/Android/media/$packageName' folder path programmatically? | How to get '/storage/emulated/0/Android/media/$packageName' folder path programmatically?
Currently I can use both
val path: File? = Environment.getExternalStorageDirectory()?.let { File(it, "Android/media/${context.packageName}") }
and
val path: File? = context.externalMediaDirs.firstOrNull()
Is there any b... | https://stackoverflow.com/questions/79911503/how-to-get-storage-emulated-0-android-media-packagename-folder-path-programm | android, kotlin | 1,774,026,212 |
se_79911149 | stackoverflow | MOBILE_DEVELOPMENT | Media notification image appears pixelated | Media notification image appears pixelated
I’m experiencing an issue with a pixelated image on some Samsung devices in media notifications and on the lock screen. I’ve tried loading the image using both a ByteArray and a Uri. The source image is a 1024×1024 PNG (~8 KB). I’ve tested both scaled and unscaled versions. C... | https://stackoverflow.com/questions/79911149/media-notification-image-appears-pixelated | android, kotlin, mobile, notifications, media | 1,773,993,848 |
se_76253202 | stackoverflow | MOBILE_DEVELOPMENT | How to make synchronized movement of Bottom sheet dialog fragment and keyboard? | How to make synchronized movement of Bottom sheet dialog fragment and keyboard?
I want to make bottom sheet dialog and keyboard synchronized movement in android, kotlin. I start bottom sheet dialog fragment from another fragment by navController:
private fun listeners(){
binding.btnBottomSheetDialog.setOnClic... | https://stackoverflow.com/questions/76253202/how-to-make-synchronized-movement-of-bottom-sheet-dialog-fragment-and-keyboard | android, kotlin, keyboard, android-bottomsheetdialog | 1,684,146,811 |
se_77801772 | stackoverflow | MOBILE_DEVELOPMENT | NoSuchMethodException thrown by HiltWorker with additional parameters | NoSuchMethodException thrown by HiltWorker with additional parameters
I get the following exception for 2 of my CoroutineWorkers with additional parameters injected by Hilt. This does not happen for workers without additional parameters and only happens when I install the app via APK by my fastlane build. Android Stud... | https://stackoverflow.com/questions/77801772/nosuchmethodexception-thrown-by-hiltworker-with-additional-parameters | android, kotlin, dagger-hilt, android-workmanager | 1,704,991,775 |
se_79909428 | stackoverflow | MOBILE_DEVELOPMENT | A third party app can work as middleware while file accessing by another app in android? | A third party app can work as middleware while file accessing by another app in android?
I am new in android development with good at web devlopment and DSA 3rd year Computer science student,
I am currently makeing a android app as an acadminc project file security during send to another app
my idea is for example whe... | https://stackoverflow.com/questions/79909428/a-third-party-app-can-work-as-middleware-while-file-accessing-by-another-app-in | android, kotlin | 1,773,766,037 |
se_79909826 | stackoverflow | MOBILE_DEVELOPMENT | Unknow error in Kotlin : "kotlin.NotImplementedError: Implemented only in JetBrains fork", can someone help me with that? | Unknow error in Kotlin : "kotlin.NotImplementedError: Implemented only in JetBrains fork", can someone help me with that?
I have an error in my Kotlin project that I don't understand.
The project was working but then I clone it on another PC and on this other PC I have this error below:
FATAL EXCEPTION: main... | https://stackoverflow.com/questions/79909826/unknow-error-in-kotlin-kotlin-notimplementederror-implemented-only-in-jetbra | android, kotlin, mobile | 1,773,825,355 |
se_79787109 | stackoverflow | MOBILE_DEVELOPMENT | How to create a searchable dropdown/autocomplete TextField in Jetpack Compose without the suggestion list stealing focus? | How to create a searchable dropdown/autocomplete TextField in Jetpack Compose without the suggestion list stealing focus?
My Goal:
I'm trying to implement an autocomplete TextField in Jetpack Compose. The desired behavior is:
A user starts typing in a TextField.
A list of suggestions, filtered by the user's input, a... | https://stackoverflow.com/questions/79787109/how-to-create-a-searchable-dropdown-autocomplete-textfield-in-jetpack-compose-wi | kotlin, material-ui, android-jetpack-compose, kotlin-multiplatform | 1,760,082,908 |
se_71243382 | stackoverflow | MOBILE_DEVELOPMENT | How to set background color in Google Filament for Android? | How to set background color in Google Filament for Android?
I'm following this tutorial for Filament: https://medium.com/@philiprideout/getting-started-with-filament-on-android-d10b16f0ec67
How do I set the background color to white?
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInst... | https://stackoverflow.com/questions/71243382/how-to-set-background-color-in-google-filament-for-android | android, kotlin, surfaceview, google-filament | 1,645,646,746 |
se_79906871 | stackoverflow | MOBILE_DEVELOPMENT | How can I edit a Kdoc scheme on methods in IntelliJ? | How can I edit a Kdoc scheme on methods in IntelliJ?
IntelliJ has this nice feature where when I go above a method header and write /** and then press Enter it gives me a comment template like this in kotlin:
/**
*
*
*/
foobarMethod(foo: String, bar: String)
But it misses the param tags. I want it to generate comment... | https://stackoverflow.com/questions/79906871/how-can-i-edit-a-kdoc-scheme-on-methods-in-intellij | kotlin, intellij-idea | 1,773,403,136 |
se_78549083 | stackoverflow | MOBILE_DEVELOPMENT | How can I react to click event on TextField composable? (no boilerplate code) | How can I react to click event on TextField composable? (no boilerplate code)
How can I react to click event on TextField composable without writing all this boilerplate code?
OutlinedTextField(
value = ...,
onValueChange = {},
readOnly = true, // needed to avoid showing the keyboard
// boilerplate cod... | https://stackoverflow.com/questions/78549083/how-can-i-react-to-click-event-on-textfield-composable-no-boilerplate-code | kotlin, android-jetpack-compose | 1,716,980,635 |
se_79909098 | stackoverflow | MOBILE_DEVELOPMENT | IntelliJ's composable preview engine is stuck after an error | IntelliJ's composable preview engine is stuck after an error
I've got a Windows Desktop Application in Jetpack Compose and sometimes when I manage to break my code and refresh the preview, the preview engine immediately shows an error, as it should. However, even when I fixed it, the engine gets somehow stuck and ... | https://stackoverflow.com/questions/79909098/intellijs-composable-preview-engine-is-stuck-after-an-error | windows, kotlin, intellij-idea, android-jetpack-compose, preview | 1,773,739,381 |
se_79782181 | stackoverflow | MOBILE_DEVELOPMENT | Why can't I use @JsExport in commonMain? Workaround with expect/actual seems to work fine | Why can't I use @JsExport in commonMain? Workaround with expect/actual seems to work fine
So I'm working on a Kotlin Multiplatform project and ran into this weird limitation - you can't use @JsExport in commonMain, only in jsMain. This seems really counterintuitive since the whole point of KMP is to share code acr... | https://stackoverflow.com/questions/79782181/why-cant-i-use-jsexport-in-commonmain-workaround-with-expect-actual-seems-to | kotlin, kotlin-multiplatform, kotlin-js | 1,759,527,899 |
se_79788304 | stackoverflow | MOBILE_DEVELOPMENT | Is there any real difference between GlobalScope and CoroutineScope? | Is there any real difference between GlobalScope and CoroutineScope?
I'm trying to understand the difference between the two.
If a CoroutineScope is not tied to any lifecycle-aware component, then I think they behave the same.
If I'm not passing any context to CoroutineScope, then both would initialized with EmptyCoro... | https://stackoverflow.com/questions/79788304/is-there-any-real-difference-between-globalscope-and-coroutinescope | android, kotlin, kotlin-coroutines, cancellation | 1,760,227,793 |
se_71103198 | stackoverflow | MOBILE_DEVELOPMENT | How to remove RadioButton's padding in Jetpack Compose? | How to remove RadioButton's padding in Jetpack Compose?
I have a problem with RadioButton component in my Jetpack Compose application. I have some RadioButtons with text and this have a lot of padding by default. Can I remove this padding or to set a custom padding to avoid a lot of space between each?
Currently I... | https://stackoverflow.com/questions/71103198/how-to-remove-radiobuttons-padding-in-jetpack-compose | android, kotlin, android-jetpack-compose | 1,644,773,413 |
se_79908759 | stackoverflow | MOBILE_DEVELOPMENT | What to use for encrypting Room Database in Android now that EncryptedSharedPreferences and MasterKeys are deprecated? | What to use for encrypting Room Database in Android now that EncryptedSharedPreferences and MasterKeys are deprecated?
I recently started a new Android app project using Kotlin and Jetpack Compose. I added code to setup the Room database, so I can store data locally with the app. I now have a need to encrypt the data ... | https://stackoverflow.com/questions/79908759/what-to-use-for-encrypting-room-database-in-android-now-that-encryptedsharedpref | android, kotlin, encryption, android-room | 1,773,690,678 |
se_79755796 | stackoverflow | MOBILE_DEVELOPMENT | Why is the action of Mutex.withLock not marked as suspend? | Why is the action of Mutex.withLock not marked as suspend?
The action parameter of the withLock function is a lambda without the suspend keyword. Is there a reason for this missing keyword?
In most cases, this lack of the suspend keyword isn't an issue because, due to withLock also being an inline function, suspend fu... | https://stackoverflow.com/questions/79755796/why-is-the-action-of-mutex-withlock-not-marked-as-suspend | kotlin, kotlin-coroutines | 1,756,993,639 |
se_73634520 | stackoverflow | MOBILE_DEVELOPMENT | How can I tell from code if development mode is active in Ktor? | How can I tell from code if development mode is active in Ktor?
How can I tell from code if development mode is active in Ktor? I'd like to force login a test user when development mode is active to facilitate manual testing. | https://stackoverflow.com/questions/73634520/how-can-i-tell-from-code-if-development-mode-is-active-in-ktor | kotlin, ktor | 1,662,549,260 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.