97,868 questions
0
votes
0
answers
21
views
Android Kotlin: removeLastOrNull for MutableStateFlow List
Currently developing Android app on Android Studio in Kotlin.
I'm new to the recent Android development.
Some articles say when I use MutableStateFlow and collections like MutableList, I should assign ...
0
votes
0
answers
22
views
Kotlin destructuring declaration from a run block -- compiler error, or my error?
In the example below, if I try to turn val x into val (x,y) IDE complains vigorously.
If I try to make the return an explicit pair for the val (p,q) assignment it get the same errors.
I do not ...
-1
votes
0
answers
23
views
mesibo Compilation Error: Unresolved reference 'MessageParams' in Mesibo Android SDK 2.7.19 (Kotlin)
I am integrating the Mesibo Android SDK (version 2.7.19) into my Kotlin application. I need to implement the Mesibo.MessageListener interface to receive real-time messages, but I am facing a ...
0
votes
0
answers
54
views
Device Admin APK checksum mismatch when provisioning via QR on a fresh Android device
I'm trying to provision an Android Device Admin app on a completely fresh device using a QR code. Previously, I encountered an error about missing components, but now the app fails with a checksum ...
Advice
1
vote
2
replies
51
views
Flutter build issues
I have a old laptop and I started my journey in flutter .The problem is with flutter build .every time I run flutter build command firstly it takes much time I also tried to change my local. ...
1
vote
1
answer
42
views
Parsing Streaming response from OpenAI using Retrofit and Gson/Moshi
I'm trying to parse the response from OpenAI transcription API with streaming enabled.
The request is:
curl https://api.openai.com/v1/audio/transcriptions \
-H "Authorization: Bearer $...
0
votes
0
answers
39
views
Flows not updating [closed]
I have two flows: activityState and activityUiState. I need the activityUiState to be of type MutableStateFlow, so I'm using the activityState as a Flow to update the value of the activityUiState. The ...
-1
votes
1
answer
57
views
How to avoid duplicating state between parent and child screens when passing parameters built by childs?
In Jetpack Compose with MVVM, I have a parent screen that contains 3 child screens. Navigation is used to move between the child screens.
Each child screen can generate a PDF in different ways:
One ...
0
votes
0
answers
48
views
In Kotlin, Is there a way to hold weak reference to a function?
I realized that Kotlin is missing a built-in event mechanism similar to what we have in C#.
So I tried to implement my own and ran into a problem that can easily lead to memory leaks.
My original idea ...
0
votes
0
answers
27
views
Using Kotlin Data Classes for DynamoDB
I have the following class that I am using as a dynamodb item in Kotlin
@DynamoDbBean
data class Transaction(
@get:DynamoDbPartitionKey
val userId: Int,
@get:DynamoDbSortKey
val ...
0
votes
1
answer
50
views
"Type argument is not within its bounds: must be subtype of 'Any'" in Kotlin application after upgrade to Spring Boot 4.0.0
After upgrading my Kotlin application from Spring Boot 3.5.8 to Spring Boot 4.0.0,
I get a lot of compiler errors
Type argument is not within its bounds: must be subtype of 'Any'.
How is it possible ...
0
votes
0
answers
50
views
Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
I'm using an old version of Android Studio, 3.1.6.
This error appears when the gradle project sync failed. I also have a new version of android studio installed, I dont know if this could be related, ...
1
vote
1
answer
67
views
Does View.getHeight/getWidth include padding?
I was under the impression that the value returned by View.getWidth() includes padding in it. I don't think I'm hallucinating things - a common line of code that Android developers write is something ...
3
votes
1
answer
74
views
Is it possible to assign a function reference when overriding a function?
I have a scenario where I am implementing an interface that requires a function:
interface I {
fun exec(s: String): Int
}
and the function that I want to use is already defined somewhere else:
fun ...
-1
votes
0
answers
55
views
Spring Boot 3 WebFlux + Kotlin + @JsonValue wrapper fails for String / Boolean / Enum responses (ClassCastException)
I'm migrating a Kotlin + Spring WebFlux application from Spring Boot 2.5.x to Spring Boot 3.5.x, and several controller endpoints that used to work now consistently fail with ClassCastException.
🔍 ...
1
vote
0
answers
34
views
Android Auto NavigationTemplate: routing card in top-left corner not showing
I’m implementing an Android Auto navigation app using the Android for Cars App Library in Kotlin.
The app runs on Android Auto and shows the NavigationTemplate with the map, but the routing / maneuver ...
3
votes
1
answer
60
views
No longer see trace/span IDs after upgrading to spring boot 4
After upgrading to Spring Boot 4 I don't see any span/trace ids in my logs where I used to
@GetMapping
fun hello(): String {
logger.info("Hello World!")
return "Hello World!&...
0
votes
0
answers
48
views
Navigation sound at start sometimes missing
Please check for me if the code is correct, the function call position is reasonable.
Because there is currently a problem that the navigation sound when starting Navigation is sometimes absent.
...
1
vote
0
answers
69
views
Return type mismatch: expected 'Any', actual 'Authentication?'
I tried to upgrade my codes to Spring Boot 4.0.0, and given the following Kotlin codes,
@Bean
fun auditorAware(): ReactiveAuditorAware<String> = ReactiveAuditorAware<String> {
...
0
votes
0
answers
44
views
Implement ScaleGestureDetector and Listener in Android Studio using Kotlin and SceneView
I am working on a "simple" Android augmented reality application. I’m very new to Android programming, although I’ve been in software development for decades, particularly Python, and C/C++ ...
0
votes
0
answers
74
views
How to disable the “minimize” button in AndroidX CustomTabs?
I’m using androidx.browser.customtabs with a CustomTabsIntent to open a webpage inside my Android app.
Chrome shows a minimize button (a small arrow/down icon) in the Custom Tab UI, allowing the user ...
2
votes
1
answer
58
views
How to handle errors in compose viewmodels?
Imagine something like this:
class FileModel: ViewModel() {
private val _state: MutableStateFlow<FileState> = MutableStateFlow(initialState)
val state: StateFlow<FileState> = ...
-1
votes
0
answers
110
views
Running my app causes an AbstractMethodError [closed]
Everytime I try to run the app in Android Studio, this error appears.
java.lang.AbstractMethodError: Receiver class androidx.room.migration.bundle.FieldBundle$$serializer does not define or inherit ...
-2
votes
1
answer
75
views
How i disable bounce effect if button is not enabled? [closed]
I have disabled ripple effect in my entire project using CompositionLocalProvider.
@Composable
fun SpotifyTheme(
content: @Composable () -> Unit,
) {
val colorScheme = colorScheme
...
0
votes
1
answer
50
views
Accessiblity not clicking on "Force stop" at all
I can verify that onAccessibilityEvent and onServiceConnected functions are triggered, but nothing expected happens.
Here is my AndroidManifest.XML
<?xml version="1.0" encoding="utf-...
0
votes
1
answer
59
views
Latest version of Compose Maps dependency throws "IllegalArgumentException: source must not be null"
When using com.google.maps.android:maps-compose in version 6.12.2 I get the following error building the project:
org.jetbrains.kotlin.util.FileAnalysisException: While analysing <redacted>/...
-1
votes
0
answers
44
views
LazyColumn flingBehavior problem in Jetpack Compose [closed]
I used the following code in Jetpack Compose to position items in the center of the screen and I succeeded, but when I click on the item, the item moves down and the flingBehavior effect disappears. ...
0
votes
0
answers
43
views
Spring Data Elasticsearch adds new Date field as text in existing index mapping
I'm using Kotlin + Spring Boot 3.4.1 with spring-boot-starter-data-elasticsearch and Elasticsearch 8.12.2.
Existing document:
@Document(indexName = "crashes_summary")
data class CrashSummary(...
0
votes
0
answers
38
views
Error in executing credential manager api [closed]
I am trying to execute camara number verification 2.0.0 in my app. Currently I am stuck about how the call is going to be to the mobile os so that it trigger request to entitlement server for the ...
Best practices
3
votes
0
replies
36
views
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 ...
2
votes
2
answers
120
views
Difference in Double representation between Kotlin and Swift
In Kotlin, if you do println(String.format("%.17f", 10.45)), you will see 10.45000000000000000 in the output.
In Swift, if you do print(String(format: "%.17f", 10.45)) you will see ...
Advice
1
vote
1
replies
60
views
Custom overlay when detecting device recording
I am trying to make a custom overlay for my application that will hide the screen if any screen share or unauthorized recording of my app is running.
The problem is, that I am trying to avoid using ...
0
votes
0
answers
71
views
Push Notification on Flutter Mobile Apps [closed]
I am developing 2 mobile applications (main & admin) using Flutter for my client and this is my very first time developing a mobile apps. I need help with push notification on both apps because I ...
0
votes
0
answers
31
views
Koin VM/navigation on Kotlin Multiplatform - singleton viewmodel becoming unable to launch coroutine after popBackStack
Maybe I'm doing something wrong but this seems very strange to me took me a while to track down the cause but basically ViewModels are getting corrupted whenusing popBackStack or swipe left, vm's are ...
3
votes
1
answer
91
views
Does combine conflate flows?
When I use combine() on two flow, it's not supposed to conflate/skip values. But when I collect a combine of 2 flows in a Coroutine, some values are randomly skipped.
Link to the kotlin playground : ...
3
votes
1
answer
81
views
Why is the getOrElse() function of arrow-kt returning Any?
I am trying to understand the getOrElse() function of arrow-kt. I want to create a simple function that takes a list of strings, filters them, and returns the first matching value as an Option<...
0
votes
1
answer
32
views
When I load all NodeEntity entities with depth = 2 and store one without depth an inconsistency appears. What have I misunderstood?
I defined these simple models
@NodeEntity(label = "Api")
class Api {
@Id
@Property(name = "name")
var name: String = "name"
@Suppress("unused")
...
Advice
0
votes
2
replies
49
views
how can I improve seat rendering in compose when the layout is separated by section, row, and column
I confused why my apps is lagging when I scroll down to this seat layout, what's wrong with my code? Can somebody tell me how can I improve the performance. Here is my code that I used for to create ...
1
vote
0
answers
48
views
Hilt - java.lang.String com.squareup.javapoet.ClassName.canonicalName() [closed]
I'm learning Android development and decided to add Dagger Hilt to my project. I've been struggling for a week with the `:app:hiltAggregateDepsDebug` task error.
It throws: `Unable to find method '...
-3
votes
0
answers
49
views
Get current location (longitude, latitude) once directly without using Google APIs? [duplicate]
I'm using Kotlin and Compose, and I can't figure how to get the current location once via only GPS. I don't want to use Fused Location Provider. The location doesn't have to be precise and it's not ...
1
vote
1
answer
79
views
Replacing Arrow's deprecated orElse with getOrElse doesn't work [closed]
I'm working on migrating some existing Kotlin code from Arrow 1.x to 2.x. The old code looked something like this:
fun filterStrings(incoming: List<String>): Option<String> = incoming
....
2
votes
2
answers
130
views
Kotlin script - can't run if full path contains space [closed]
Kotlin compiler is located in C:\kotlinc\bin, when trying to run any script that is located in a path with space - it fails with message
InvalidPathException: Illegal char <:> at index 2: /H:/My%...
0
votes
0
answers
32
views
Spring Webflux Dynamic path control in the filter layer
in my Spring WebFlux project, I cache endpoints with specific annotations at application startup time using the following DTO.
data class ExplorerResult<T>(
override val supportedPaths: Set&...
0
votes
0
answers
49
views
How to keep a specific LazyColumn item visible when the keyboard opens?
I have a bottom sheet used for search, and it has two UI states. Both states share the same LazyColumn.
State 1:
LazyColumn {
item { Row { ... } } // search categories
item { Text(text = &...
0
votes
1
answer
69
views
Prevent multiple subscriptions of same topic in HiveMQ MQTT client
I'm struggling with my MQTT clients to subscribe to a topic without having the topic subscribed multiple times after the client runs for a while. (I also have an issue with the clients not processing ...
-2
votes
1
answer
114
views
LinearProgressIndicator displays wrong progress when its size is modified
I'm having trouble with the progress indication of the LinearProgressIndicator when its height is increased:
The progress is very small (1%), but the second LinearProgressIndicator shows a much ...
0
votes
0
answers
74
views
How to make a custom notification full-width?
I'm trying to create a full-width custom notification for my Flutter app on Android.
The problem is that the notification always appears centered with large horizontal margins, even though my layout ...
0
votes
1
answer
40
views
Nested populating of objects using flows
I have an activityUiState (of type ActivityUiState) object which has a list of sub-activities (of type ActivityUiState as well) and a list of voice notes. I'm trying to populate the activityUiState ...
0
votes
2
answers
67
views
How to load SVG content images(not url) using Coil on Android
For example, the SVG content obtained from the web is:
<svg t="1717950268208" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3....
0
votes
0
answers
72
views
How to hide or change navigation bar overlay color when opening bottom sheet?
im using modal bottom sheet in jetpack compose, even though im setting navigation bar color to transparent, when bottom sheet comes up, the black overlay is comes up on navigation bar, how can i hide ...