Category "kotlin"

swift "completion: @escaping" in kotlin language. How to use callback in kotlin?

I am looking for a way of completion block for my kotlin code. In Swift i have my function: func fetchRegister(with request: RegisterRequest, completion: @es

Converting RecyclerView to ViewPager / PagerAdapter

Background - New to Android, but pretty nifty with moving layouts around, understanding Java, Kotlin and XML. However this task seems to be way above my head.

How to use Kotlin with a Bukkit/Spigot plugin and Gradle

I am trying to use Kotlin for a Spigot plugin (for version 1.8.8), as I find Kotlin a lot more efficient to use. But, whenever I try and run the plugin, I get t

How to make multiple constructors in Kotlin?

I want to use library which is in Java and it has alot of errors so I'm trying to change it to Kotlin. And AndroidStudio is not converting Java to Kotlin proper

How to preview an image and only saving it if the user accepts it using cameraX

I use cameraX api for taking a picture and save an image as a file to the internal memory. When the callback for taking a picture has succeeded, I update the ui

How to create a button in Kotlin that opens a new activity (Android Studio)?

Hello I'm making an app using Android Studio and the Kotlin language and am having trouble getting my button to open a new activity. I have the button created i

How can I add a footer to Kotlin Dokka docs?

I am looking for a way to include text in the footer of all Dokka generated docs. I am not seeing this option being advertised by the Gradle or Maven plugins fo

Is there any way to drop request inside plugin

Now I'm developing server application with ktor 2(2.0.0-eap-256). What I want to do is, according to header or other information, Reject or set adequate http st

Intellij gradle kotlin project generate .class files in both java and kotlin directory

I have a Gradle Kotlin project setup in Intellij, The source directory is as follows: src main kotlin resource test kotlin resource When I

How to read an environment variable in Kotlin?

I'd like to get a certain value from an environment variable in my Kotlin app, but I can't find anything about reading environment variables in the core librari

What is the difference between var and val in Kotlin?

What is the difference between var and val in Kotlin? I have gone through this link: KotlinLang: Properties and Fields As stated on this link: The full syntax

Select image from gallery using Kotlin

Recently i have started learning Kotlin. After having some basic functionality i am stuck with image picker. Does there any specific way to select an image fro

Retrofit2 post request is successful but I'm not able to retrieve token from response body

So I'm trying to making a login(post) request to an API (https://reqres.in/api/login) with retrofit 2. The connection was successful as the response code is 200

How can I save data from intent to text file to documents folder?

I am receiving an object that I want to save with timestamp to text file in the phone's documents folder. I have currently added the permissions lines to Androi

Plugin with id 'kotlin-android' not found. flutter

I am creating a project that connected to a firebase, but I think the problem not in the firebase...... I found this error when I am trying to run the project:

RuntimeException: Error in evaluationEvaluation: status: 13 value: {message=Invalid or unexpected token}

when i uploaded to google play console, and review finished. apk rejected by showing this error. how to solve this problem, anyone have a solution? FATAL EXCEPT

Plugin com.android.application not found when running app in android studio chipmunk canary 7

I had downloaded android studio chipmunk canary 7 and faces this problem : Plugin [id: 'com.android.application', version: '7.2.0-alpha07', apply: false] was n

Kotlin: How to delay code in Android without making the UI freeze

I am trying to delay code in Kotlin I have tried Thread.sleep(1000) But its freezes the UI. Does somebody know why this is happening And how to delay withou

How to inflate custom layout in Material tooltip of a Material slider in Android?

I was trying to achieve something similar to the below image by manipulating the Material tooltip inside the Material slider. I was able to achieve something s

How to run Android Apps in a computer browser like PWA App?

I would like to compare native with cross-platform technology. I am writing Kotlin Android Native application and is it possible to easily open it in browser li