kotlin Questions

3

I'm working on a desktop application using Jetbrains Compose, but I'm open to solutions using Swing (it's used under the hood) as well. I want to implement a feature where the application window is...
Mweru asked 18/6, 2023 at 12:57

2

For this code class Foo { var name: String? = null } kotlin compiler generates: private String name; public final String getName() { ... } public final void setName(String name) { ... } Eve...
Nosography asked 22/11, 2017 at 23:46

5

Solved

When I bought the new laptop, to copy my android studio projects from old laptop to new laptop, I just copied all the projects from the folder AndroidStudioProjects to respective folder in new lapt...
Nada asked 17/1, 2022 at 1:50

6

I take an example from this codelab override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { return ComposeView(requireContext()).apply ...
Starspangled asked 18/10, 2021 at 9:1

3

How to set a connect/read timeout in the Spring's RestClient? This client has been added in the Spring Framework 6.1.
Shingly asked 29/2, 2024 at 20:45

3

Solved

I would like to read a file contents and emit a flow for every line of its contents. So, I have to implement a function with the following signature: fun InputStream.linesToFlow(): Flow<String&...
Creon asked 15/5, 2020 at 17:44

3

Solved

Im making an Alarm app, and using AlarmManager to set alarms. Im saving every alarm using Room after running the setAlarm on the AlarmManager, so I can later restore them if the phone gets turned o...
Hedvige asked 18/10, 2022 at 13:19

4

I'm building an app with Room, Retrofit and Hilt. When I run the app I get an error 2 files found with path 'META-INF/gradle/incremental.annotation.processors'. I've tried to clean and rebuild proj...
Anu asked 28/12, 2022 at 19:0

4

Solved

I want to call a private functions of class SomeClass from outside of this class: class SomeClass { private fun somePrivateFunction() { //... } private fun somePrivateFunctionWithParams(text: ...
Gaucherie asked 17/12, 2019 at 9:12

9

I've just created a new KMM project through out KMM Plugin, but I can't run or even debug in Xcode iosApp part of the project. When I try to run iosApp from Android Studio, the build process fails ...

2

Solved

I have problem with saving data to sqldelight 1.4 in Android app. I created table: CREATE TABLE myTable( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT ); In repo class I have insert f...
Zapata asked 23/1, 2021 at 20:17

5

Solved

I have already done with java but find difficult with Kotlin. I have already search with google but none of them work for me. /** * Get the json data from json file. * * @param context the con...
Retroflexion asked 10/7, 2019 at 2:21

7

I am using Room Db using coroutines in kotlin. This is my Dao interface: @Dao interface CheckListNameDao { @Insert suspend fun insertName(name: CheckListName) @Query("SELECT * FROM CheckLis...
Hardening asked 4/2, 2020 at 5:12

2

Solved

I have the following Composable @Composable fun ClickableBar(text: String, action: () -> Unit) { Row( modifier = Modifier .height(40.dp) .background(color = AppPrimaryGreen) .fillMaxWidth()...
Kendrakendrah asked 25/8, 2024 at 6:13

9

I'm trying to use Google's SMS Retriever API for Automatic SMS Verification. I have followed the directions here but my app is not receiving any SMS messages. Here is what I've done: I've added th...
Landrum asked 24/12, 2018 at 0:51

3

Solved

I have a List<T?> containing null values (which, I suppose, is not forbidden). If one element of this list is null, I want the entire list to be null (what Haskell people call sequence). The ...
Correlation asked 11/3, 2016 at 17:23

8

I upgraded the SDK to Flutter version 3.24 yesterday, but today I'm encountering an error when trying to launch the app. I added the new version of Kotlin and changed the kotlin-stdlib-jdk7 version...
Nystagmus asked 9/8, 2024 at 11:18

6

In Kotlin, we have val that is final and can't be change. e.g. val something = "Something" If a value that is is initialized later, we use lateinit var. lateinit var something: String But thi...
Fireproofing asked 19/2, 2018 at 1:26

2

Trying to login with the Google Button in my android app using the credential manager, but the login shows the activity is cancelled by the user while choosing the gmail account from the popup. But...
Bowdlerize asked 26/12, 2023 at 12:50

2

Solved

I am facing an issue when I am Using Gradle to output my Android APP in Android Studio, I am getting such error, the error was there in sync, then I tried to sync and the AVD was working, and the s...
Willie asked 15/12, 2021 at 6:46

3

I'm trying to create a @Preview function for a ModalBottomSheet in Jetpack Compose, but I'm only seeing a white screen. Here's my SomeModalBottomSheet composable: @OptIn(ExperimentalMaterial3Api::c...

4

Is it possible to implement a concurrent hash map purely in Kotlin (without Java dependency)? I am new to Kotlin and it looks like there is no obvious API available in kotlin.collections.
Pydna asked 2/11, 2020 at 21:49

6

Solved

I am facing an error: Some Kotlin libraries attached to this project were read by a newer Kotlin compiler and can't be read. Please update Kotlin Plugin I just created an application and started ...
Kedron asked 8/6, 2022 at 19:35

4

abstract class ServerMock(param: String) { protected var someVar = params + "123" fun justMyVar() = someVar } Usage example: class BaseServer(param: String) : ServerMock(param) { val...
Saxecoburggotha asked 10/1, 2021 at 18:49

2

Solved

I try to learn how to decompile Android program(APK) and found this site Decompilers online . It´s working grate for java code but when there are Kotlin files code the decompiler produces java code...
Moisten asked 11/3, 2019 at 7:10

© 2022 - 2025 — McMap. All rights reserved.