Questions tagged [kotlin]

Kotlin is a cross-platform, statically typed, general-purpose high-level programming language with type inference. This tag is often used alongside additional tags for the different targets (JVM, JavaScript, native, etc.) and libraries/frameworks (Android, Spring, etc.) used by Kotlin developers, if the question relates specifically to those topics.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

How to dismiss a Material Alert Dialog in Kotlin

I have created this Material Alert Dialog. I want to dismiss it once the record is update or when user click cancel button (btnCancel). I am unable to use dismiss() as it's not available. private fun ...
Abdul Lateef Sherani's user avatar
-2 votes
0 answers
12 views

Badge notification count with Kotlin and Android Studio

app icon: home button: how can I display the unread messages badge on my app icon like it display to my home button?
Josh Ivan Lanuevo's user avatar
0 votes
0 answers
15 views

English to Japanese Translation feature in the app

I am currently working with english to japanese feature in an app on the kotlin android studio, but my problem is that even though some of the translation is working, there are translated text that is ...
Rey Mark Enriquez's user avatar
1 vote
1 answer
27 views

In Jetpack Compose, how can you make a new element always appear on the top of whatever content there is?

I have two buttons, each one will make a text appear on the top of the screen content. If I press Button A, then a text "Here is A" should appear at the top of the screen. If I press Button ...
user22376410's user avatar
0 votes
0 answers
12 views

Ktor getting 403 forbidden error when requesting api using cloudflare

I started a new Android project.This time I decided to use Ktor instead of Retrofit as a network client.The api uses CloudFlare.When I send a request to the api, I get a 403 Forbidden Error.If I use ...
Mehmet Peker's user avatar
0 votes
0 answers
11 views

Android Jetpack Compose states form external class

I am starting to learn Compose in Android and regarding states for me is clear how to use them for "internal" states, that means for instance if a checkbox is checked or a DropDown item is ...
soyxan's user avatar
  • 51
0 votes
0 answers
12 views

iOS crash when using MOKO resource library

I had this issue couple of days ago that i couldn't actually resolve with MOKO resource library, the stringResource is used in Compose multiplatform, the app run with no issues on android but on iOS ...
Mado's user avatar
  • 377
0 votes
0 answers
13 views

Android MaterialDatePicker open on year selector

I would like to open the MaterialDatePicker to show the year selector on start before showing the actual calendar. I managed to display it by clicking the Year Button manually when the fragment is ...
Janjan Medina's user avatar
0 votes
0 answers
7 views

How does Quarkus Kotlin/Java Interoperability work?

I have a regular Quarkus Java application and I want to introduce some Kotlin classess via CDI and also the Event Bus but the following isn't working as I thought it would. Case #1 - Event Bus Kotlin ...
Charlie's user avatar
  • 2,054
0 votes
0 answers
10 views

how to clear console with Kotlin

I'm creating a program that runs in console in Kotlin (android stodio) some times I need to clear console to show other things or update informations how should I do that (I'm using windows) for ...
Ali Farhad's user avatar
0 votes
1 answer
15 views

Should I use CoroutineScope(Dispatchers.IO) when do a parallel call to another microservice?

Let's say we have a getProducts() method in a controller: @RestController @RequestMapping("/products") class ProductController( ... ){ suspend fun getProducts(): ProductsDto { ...
Ekaterina's user avatar
  • 1,692
0 votes
0 answers
20 views

Problem with 'Getting started with Android SDK' + any Compose Spotify SDK tutorials?

I am trying to find a way to use the Spotify SDK in Android using Jetpack Compose in Kotlin. All the resources I've found till now about this seem to use Views and not Compose. I still did the Spotify ...
Dean Montanaro's user avatar
0 votes
0 answers
33 views

Show floating avatars in recyclerview items in Android?

I have a recyclerview of message items, which shows messages with avatars in the end left side infront of the message. If we have a multiple message sent by the same sender we showing its avatar only ...
Manuchekhr Tursunov's user avatar
0 votes
1 answer
36 views

Kotlin, How to pass array elements as seperate paramentes to a function

I am using Room DB in which my table has several columns (34 to be exact). I get data in an array (33 size). How can I pass all of the elements of the array to the constructor of the data class which ...
Malhar's user avatar
  • 81
-3 votes
0 answers
61 views

What is the proper builder design for complex object field?

Let's say we have a class class Foo { private String fooField1; private String fooField2; private String fooField3; private Bar bar; ... } class Bar { private String barField1; private ...
gstackoverflow's user avatar
0 votes
2 answers
47 views

"this expression" in Kotlin

I know the meaning of "this expression" in almost language. But below code in Kotlin make total confuse: fun <A, B, C> (A.(B) -> C).swap(): (B.(A) -> C) = { a: A -> // 1 a....
tu tu's user avatar
  • 1
1 vote
0 answers
26 views

How to add on long click on floating action button in Jetpack Compose? [duplicate]

I need to add two events on FAB, a single click and a long click. This is what I have tried: @Composable @ExperimentalFoundationApi fun MyFAB() { FloatingActionButton( modifier = Modifier ...
Always Learner's user avatar
1 vote
1 answer
30 views

Mockito's `thenReturn` is not working for data class field

So i have a class: data class LoyaltyVoucher( val voucherNumber: String, ... ) And in instrumental test i want to mock this field: val serverVoucher = Mockito.mock(LoyaltyVoucher::class.java) ...
Nik Myers's user avatar
  • 1,863
0 votes
0 answers
7 views

Kotlin BuildConfig Deprecated in SDK 34 (target API 13), what is new method

android.BuildConfig.DEBUG and BuildConfig are no longer available. I even added in build.gradle compileOptions { kotlinOptions { freeCompilerArgs += "-opt-in=kotlin.reflect.optIn"...
Shimon Rothschild's user avatar
0 votes
1 answer
23 views

"While My App installing Using QR code of Device Owner app, it says Blocked by Play Protect"

enter image description here I have created a device owner app but I am having trouble installing it on a real device. I'm generating Qr Code Using https://datalogic.github.io/aeqrdoc/generat. The ...
Ahmed Adel AbdElGelil's user avatar
0 votes
0 answers
17 views

Compiled JavaFX app crashes immediately and silently

After some time I've returned to the native compilation game for JavaFX applications; in the meantime I've build a lot of stuff with JavaFX, but I only rarely touched GraalVM. After some problems with ...
dzim's user avatar
  • 1,131
0 votes
0 answers
8 views

Android Paypal Dependency issue

i have a project in which everything is working except paypal whenever i try to implement paypal checkout dependency it says android artifact error Caused by: org.gradle.api.internal.artifacts....
Nain Malik's user avatar
1 vote
0 answers
10 views

Integrating Face Recognition in Android App with BiometricPrompt

I am currently working on adding face recognition capabilities to my Android app using BiometricPrompt, but I am facing issues with its implementation. Here is the relevant part of my code: fun ...
Hugo Oliveira's user avatar
0 votes
0 answers
3 views

Fetch chrome cast device data after connecting to the android tv

I am beginner in Android Tv developement. Will be uploading app in chrom cast ,so before actual app starts app should collect below data from chrom cast. Device serial number Device Mac Once connected ...
Stubborn's user avatar
0 votes
0 answers
28 views

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 is crashing my app [duplicate]

I'm newbie and i'm trying to create a app to check bus ticket I have a problem with this function but i dont know what it is. fun mostrarBilhete(){ strMostraBilhete = "Automacao\n&...
João Pedro Leite de Oliveira's user avatar
3 votes
1 answer
80 views

Extremly bad perfomance of ArrayList<Int> for large number of elements compared with IntArray

I made 2 implementations of quick sort: sequential and parallel. The second one was written using ForkJoinPool using 4 threads (I added implementaton below) The sort function worked with ArrayList: ...
avelobos's user avatar
0 votes
1 answer
30 views

Mock extension function in kotlin-stdlib

I have a method to download content from streaming end point. I want to write unit test this method. What I faced a problem is I need to mock kotlin extension method file.outputStream() but I can't ...
Abu Yousuf's user avatar
  • 5,852
0 votes
0 answers
28 views

How to implement a launcher chooser dialog in a Flutter app for Android?

I am currently developing an Android launcher app using Flutter, and I'm working on implementing a feature where, upon pressing the home button, the user is prompted to choose between the default ...
Fayis Fazio's user avatar
0 votes
1 answer
30 views

Jetpack Compose: Align a widget in left and right of the parent container in both wrapContent and fillmaxsize state

I have one container with 2 Text and the container will be initially in wrapContent and when clicked it will take fillMaxSize with animation. In both cases I want one text in the left and one text in ...
It's me Priyesh's user avatar
-2 votes
0 answers
25 views

Firestore data structure guidance for a flashcard app [closed]

I am creating a flashcard app (mobile only, no web) with in-built flashcards (millions of pre-made cards only). I will be organising them hierarchy wise and I am worried about writes count when user ...
Distant Metastasis's user avatar
-1 votes
2 answers
46 views

Communication between Service and fragment

How can we communicate/pass data betweeen service and fragment I am trying to make a service and i am doing some action in that and i want to update my fragment ui state according to that action which ...
Usman Mahmood's user avatar
1 vote
0 answers
16 views

Android 11-14/Error in BluetoothSocket: java.io.IOException: read failed, socket might closed or timeout, read ret: -1 [duplicate]

I am developing an android app on kotlin to connect via bluetooth to odb2 and I get an error: java.io.IOException: read failed, socket might closed or timeout, read ret: -1 ...
Alexandr's user avatar
2 votes
1 answer
21 views

New jOOQ Gradle Plugin can not process self-reference relation correctly

When switching to the new jOOQ Gradle plugin 3.19.0, another issue I found the former example entity which includes a field refers to itself does not work. The attempt of upgrading new Gradle plugin ...
Hantsy's user avatar
  • 8,282
1 vote
0 answers
19 views

Camera image quality issue using u crop library

I am using ucrop library for cropping the image, but after clicking the image and sending to the urop, quality getting reduced.I tried by using extradata,but the ucrop didn't worked with that Here is ...
Dev's user avatar
  • 21
0 votes
0 answers
10 views

How do I include VolleyPlus Library in Android studio Project in Kotlin

I am trying to add VolleyPlus library in my android studio project but I still cannot access its classes. I specifically need SimpleMultiPartRequest class of this library. https://github.com/DWorkS/...
Saad Farukh's user avatar
0 votes
0 answers
14 views

While doing some process how to block others in Jetpack Compose Android Studio?

In my application the main idea is first you select a target water liter then you click button and you fill your water level. Here after user reached the target I write You Reached Your Target and ...
Yunus Emrah Uluçay's user avatar
-1 votes
0 answers
20 views

Implementing Unread Message Count Badge on App Logo in Kotlin for an Existing Chat System

I'm new to mobile app development, having studied it for just a week. The project I'm working on is an existing chat system with an implemented unread message count badge inside the app, specifically ...
Josh Ivan Lanuevo's user avatar
0 votes
0 answers
23 views

How can I create a library of a private repository without subscription?

I have just started learning to create libraries and I have successfully created my library, but when I tried to create a release of my library on jitpack.io it showed me a message called "No ...
Saurabh Jain's user avatar
0 votes
0 answers
14 views

How can I hijack the twitter embedded post play back button in Android

I am working on my side project where I am showing embedded tweet in web-view. Some of the tweet's contain video. On iOS when I click on the blue play back button, it starts the video in full screen ...
Adil Bhatty's user avatar
  • 17.2k
0 votes
0 answers
19 views

IllegalArgumentException when using Int.MAX_VALUE as page size in Jetpack compose HorizontalPager

I have implemented a infinite scrolling HorizontalPager in Jetpack compose. Intially it worked ok but recently i am getting (java.lang.IllegalArgumentException: Cannot coerce value to an empty range: ...
Mubashir P A's user avatar
1 vote
1 answer
34 views

Failed when upgrading to use jOOQ Gradle plugin to generate codes

jOOQ 3.19.0 brings an official gradle codegen plugin instead of the 3rd party plugin, I tried to change the original config to the following in my Gradle Kotlin project. jooq { //version.set(${...
Hantsy's user avatar
  • 8,282
0 votes
0 answers
8 views

Unable to query Mongo with Kotlin nullable List

I am in process of converting a Java (Jersey) application to a Kotlin (Spring Boot) application. I used IntelliJ's built in Java to Kotlin converter to do the conversion. Most of my Kotlin models ...
printfmyname's user avatar
0 votes
1 answer
30 views

Implementing Notification Badge on App Icon for Chat Counts in Android using Kotlin

How can I show notification count in Kotlin Android on Home screen app launcher icon with count?
Josh Ivan Lanuevo's user avatar
-1 votes
0 answers
6 views

Implement word count on a loaded webpage using WebView in my Android application

I'm working on an Android application that uses WebView to load web pages. I'm looking to improve the user experience by adding a word search feature and implementing word counting on loaded web pages....
JArt.py's user avatar
-1 votes
1 answer
37 views

The Android App Bundle was signed with the wrong key. Select the correct key and try again

`created a new key (android/app/upload-keystore.jks) and what should I do to change it in Google Play Console? because I lost the new key (accidentally deleted it) there are no copies........ terminal:...
Даулет Жунусов's user avatar
0 votes
1 answer
30 views

How to disable future dates in Android Compose Material3 DatePicker?

I have a DatePickerDialog with a DatePicker, both imported from the androidx.compose.material3 package. I believe it should be possible to disable future dates with the dateValidator DatePicker ...
Chris Kobrzak's user avatar
0 votes
0 answers
32 views

Kotlin Isn't Generating A Visible Setter For Delegate

Given the code below, I would expect this class to expose an implicitly created getter and setter for the property selectedNamespace, however only a getter is found. If I create a function named ...
JHarnach's user avatar
  • 3,964
0 votes
0 answers
25 views

kotlin sealed class list items returning null

I really didn't know what the title should be I manage navigation in a compose multiplatform application with precompose, and all screens are listed as subclasses of a sealed class. In order to form ...
ayitinya's user avatar
  • 138
0 votes
0 answers
13 views

Canhub Cropper Implementation

I was trying to use canhub image cropper for my project and was following the github documentation but I am not able to implement it properly and am getting confused. So, if anyone can help in this. ...
Rajvir SIngh's user avatar
0 votes
1 answer
47 views

Kotlin data classes, varying depending on type property

In TypeScript, we have discriminated unions. In a few words, it allows the typing analyzer to narrow down to a subtype depending on a property of this item. I need to parse a JSON response from Notion ...
nook's user avatar
  • 1,752

1
2 3 4 5
1867