Click here to Skip to main content
15,891,654 members
Everything / Programming Languages / Kotlin

Kotlin

Kotlin

Great Reads

by Ivan Osipov
We'll discuss why Kotlin is a great tool for domain specific language building
by ookami.kb
Turn Android app into Kiosk App
by Igor Kushnarev
Native windows with Kotlin Native for Linux and Windows platforms
by Igor Kushnarev
Using Vulkan API with Kotlin Native example

Latest Articles

by Petrov Vladimir
Smart Android Template for Data Performance with International Signals Code as a Sample
by Ayat Rakhishev
A walkthrough of dynamic programming
by Ivan Osipov
We'll discuss why Kotlin is a great tool for domain specific language building
by AmrDeveloper
How to get any Adapter class from model class easily and quickly

All Articles

Sort by Title

Kotlin 

1 Apr 2020 by jinwon2
I'm new to Kotlin and I was learning Kotlin in this website. link removed and I can't change Scanner type to String type. How do I do it? What I have tried: import java.util.Scanner fun main(args: Array) { val scanner =...
1 Apr 2020 by CPallini
As far as I guess (I may be wrong), you cannot do that. Here you may find typical usage of the Scanner in Kotlin: Read Data Input using Scanner in Kotlin - Kotlin Programming[^].
25 Nov 2020 by OriginalGriff
You're running late - the rest of your class was trying to get us to do this homework last week ... But I'll tell you what we told them: Quote: We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it...
25 Nov 2020 by Patrice T
Posting your homework is not a question. You show no attempt to solve the problem yourself, you have no question, your main effort is pasting the requirement, you just want us to do your HomeWork. HomeWork problems are simplified versions of the...
29 Apr 2023 by Member 10488837
Kotlin, Android Studio... - Loading a JPG file into an imageview File Permissions problem. I have a small application which I load an image from storage INITIALLY using Chooser, but on the subsequent calls directly using the handle retrieved. ...
30 Apr 2023 by Member 10488837
From the Android documentation:- Persist permissions When your app opens a file for reading or writing, the system gives your app a URI permission grant for that file, which lasts until the users device restarts. Suppose, however, that your app...
7 Apr 2021 by AmrDeveloper
How to use CodeViewAndroid Library in many projects features
4 Apr 2021 by Аккаунт Разработчика
The emulator successfully opens but without launching the app, despite all necessary components are installed. So, I have no idea how to fix this. It writes: 12:52 Emulator: handleCpuAcceleration: feature check for hvf 12:52 Emulator: added...
14 Apr 2023 by Fatema Shawki
I am currently working on an Android app that involves camera object detection. However, I have encountered some issues that need to be addressed: - The app displays a black screen after granting camera permission, requiring one or two app...
18 Jun 2020 by Rion Williams
How to avoid Kotlin minefields in Apache Beam
15 Feb 2023 by Mohd Sanaullah Siddiqui
When we call the bluetooth BLE manager for connection was success but it is getting unpair and disconnected frequently on android phone. What I have tried: fun isDevicePaired(name: String) : Boolean { if (Build.VERSION.SDK_INT >=...
17 Jul 2020 by Member 14883729
I want the users to see their profile button if they are logged then they should see "sign out" and if they are not logged then they should see "Follow" but its not working as per the code.Here is my code if(uid == currentUserUid){ ...
27 May 2022 by Phoenix Liveon
How do we implement some buildTypes and flavors configs for our project(library or an application). I had a hard time finding tutorials or references about it, especially if it is implemented in kotlin-dsl. I tried to simulate the concepts from...
27 May 2022 by Rick York
I am not entirely clear on what you are asking but I'll take a shot. First, there are two kinds of libraries you can build - statically linked and dynamically lined. You define which kind(s) in the project settings of the library's solution. ...
16 Sep 2020 by Orestis Tsanakas
fun main(args: Array) { var x=0 var y=20 for(outer in 1..3){ for(inner in 4 downTo 2){ x+=6 y++ x+=3 } y-=2 } println("$x $y") } What I have tried: i want...
16 Sep 2020 by F-ES Sitecore
Go through it on paper, or line by line in a debugger var x=0 So x is 0 for(outer in 1..3) everything in this for will loop with outer being 1 then 2 then 3. So for the first pass outer is 1; x = 0 outer = 1 for(inner in 4 downTo 2) ...
16 Sep 2020 by Patrice T
Quote: i want to understand why the result is 81 23 Why don't you watch the code as it execute step by step with the help of debugger? Your code do not behave the way you expect, or you don't understand why ! There is an almost universal...
29 Jun 2022 by Nigel Spicer 2022
Can I get help Kotlin coding. I am beginning coding and would like friends to check my code and help with errors. Small bits of code. What I have tried: trying to get video to play behind main activity xml
6 Dec 2022 by Daniel89089
#include #define SWAP(a,b) {int temp = a; a = b; b = temp;} #define N 10 void perm(char str[],int count,int t) { if (t==count-1){ for (int i=0;i
8 Jul 2021 by Member 13798091
fun main(){ val crewCrewCrew = listOf( Sloths("Jerry", false,15), Panda("Tegan"), Manatees("Manny")) crewCrewCrew.forEach { mammalFactCheck(it, Mammal::vertebraeCount) mammalFactCheck(it,...
8 Jul 2021 by Richard MacCutchan
I am not a kotlin expert, but ... crewCrewCrew.forEach { mammalFactCheck(it, Mammal::vertebraeCount) mammalFactCheck(it, Mammal::knownSpeciesCount) } ... appears to be a loop which iterates over the entries in the crewCrewCrew list...
26 Aug 2021 by OriginalGriff
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here... A very quick search gave over half a million hits: GUI development with Kotlin - Google Search[^] In future, please try to...
6 Nov 2020 by Richard MacCutchan
You already posted this question at https://www.codeproject.com/Questions/5284495/Vertical-viewpager-not-working-in-kotlin-android[^]. Please do not repost.
21 Mar 2021 by Hanaa Alaoui Belghiti
Hello everyone, I'm very very new at app development and I'm supposed to make an app for my final year project, however, I've been stuck for days having no idea to connect one activity to the drawer navigation, I really need help because I've...
18 Apr 2021 by AmrDeveloper
How to create a simple bot creator in Kotlin using only 33 lines of code
N 30 Apr 2024 by Everything Select
Function in my Dao file is: @Query("SELECT * from appData WHERE type = :type ORDER BY id DESC") fun getData(type: String): Flow> The database contains a column of automatically generated int primary key 'id', a column of...
U 30 Apr 2024 by PauliKK
The app seems to ignore the database values and defaults to "00-00-0000" for dates and "0" for streak counts, suggesting an issue with the data collection logic or state handling in the composable function.A likely cause could be incorrect data...
N 1 May 2024 by maveň08
You can try: - Collect Data Properly: Instead of directly assigning the Flow to your state variables, collect the data within the LaunchedEffect block and then update the state variables accordingly. - Separate Database Operations: Move the...
19 Jul 2018 by ookami.kb
Turn Android app into Kiosk App
16 Feb 2023 by Ayat Rakhishev
A walkthrough of dynamic programming
2 Jun 2022 by Safin Mahesania
I am working on a android application project using xampp(service.php and mysql database). When I am compiling the application the emulator shows app has stopped. When I saw the run tab the following below errors show up. I don't know how solve...
28 Jul 2020 by Member 14883729
I am making an video app in kotlin and making my own camera using surfaceview. But whenever I run my app its showing white screen and the buttons which I have added. Its returning an error E/SurfaceView: Exception configuring surface ...
1 Feb 2021 by jfriedman
When you need a janky [unsafe] way to generate communitive hash codes
17 Aug 2020 by WorldofCode
the code doestn work well . when i try to get info from my other fragment it;s show null parameter is want to send info from adapter recyclerview to a fragment with bundle but just pass null this is my code reycyclerview class...
17 Aug 2020 by OriginalGriff
We can't run that code under the same conditions you do: we don;t have access to the rest of your code or to the data it is working with. And with runtime errors, that's pretty important! Heck, we don;t even know where the error occurs in that...
20 Oct 2020 by Orestis Tsanakas
i try to run my app and i get this E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.intskot, PID: 12203 com.google.firebase.database.DatabaseException: Found setter with invalid case-sensitive name: setPostId at...
20 Oct 2020 by OriginalGriff
When you get an error message you don't understand, google it: Found setter with invalid case-sensitive name - Google Search[^] The first link tells you what causes it! See here: Java Encapsulation and Getters and Setters[^] And read what it...
22 Oct 2020 by Orestis Tsanakas
i ran the code but i have this: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.intskot, PID: 31012 java.lang.IllegalArgumentException: Path must not be empty. at com.squareup.picasso.Picasso.load(Picasso.java:332) ...
22 Oct 2020 by Richard MacCutchan
The error message is clear, you are sending a null parameter. That means that user.getImage() is most likely null. So break that down into its constituent parts and use your debugger to find out why.
26 Jan 2021 by Orestis Tsanakas
I would like to build a simple logo maker app. I would like to have a preinstalled pics to choose from l, color adjustments, and edit text only. My question is where to start and how and if you know any good tutorial. Best regards What I have...
26 Jan 2021 by Richard MacCutchan
Start by learning Kotlin, and Google is the place to find tutorials.
26 Jan 2021 by RickZeeland
See: resources-to-learn-kotlin[^]
18 Aug 2020 by WorldofCode
this is my code ... i want set on click listener for each item in recycelrview but it didn't work well override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val layoutview = ...
31 Jul 2021 by Attaullah Khan 2021
Hi! I'm trying to create a class that accepts a class parameter and its print function prints the name of provided class. class A(val t: T) { fun print() { println(t!!::class.java.simpleName) } } class B {} fun main() { ...
6 Feb 2021 by Ola Farag
How can I activate the "Contact Us" item in navigation using Kotlin in Android Studio 4.1.1? What I have tried: How can I activate the "Contact Us" item in navigation using Kotlin in Android Studio 4.1.1?
4 Jun 2022 by Krystian Chęciński
What I use: Kotlin, Jetpack Compose What I want to do: After clicking "Log In" text I would want to navigate user to the log in form What I currently have: MainActivity.kt class MainActivity : ComponentActivity() { private val...
5 Dec 2021 by MissMacDaddy
I need to create a program in Kotlin (or swift) with separate Value Returning Functions (dollars(), quarters(),dimes(),nickels(),pennies()) that counts how many dollars, quarters, dimes, nickels, and pennies are in my total. I have created the...
5 Dec 2021 by Richard MacCutchan
Here is a sample that may help. It is far from perfect but should give you an idea how to proceed. Ideally you would have another function that is called to do the printing, but you can leave that for the next assignment. fun main(args:...
11 Aug 2021 by Deepesh Mhatre 2021
I am trying to create an auction app , where every 4-5 minutes a new product is shown to the users which they can either participate or reject from entering. So what I want to do is run a global counter every 4-5 minutes for all the users i.e all...
11 Aug 2021 by Patrice T
Quote: How do I create a countdown timer which is same for all users ? Said simply, you need a single time reference, server clock is a good candidate. With server actual time and time of end of auction, you calculate a duration until end of...
31 Aug 2022 by Abhishek Tibrewal
Hi, I am working on a network monitoring app in kotlin, android. I need the ISP name for my network. Thanks. What I have tried: I have searched through developers.android.com but cannot find anything that gives me the correct answer can you...
31 Aug 2022 by Dave Kreskowiak
You're not going to find anything to give you the ISP information in any SDK. You need to be able to get your outside IP address, which you cannot do from your client without a server. Once you have that address, you need to look that address up...
7 Jul 2020 by Garth J Lancaster
Quote: but my codes were not working. that's about as useful as 'tits on a bull' for a description - please use 'Improve solution' to modify your question and explain what you get, what you expect to get, and where you think the problem is ...
8 Feb 2024 by Ayush Thakur from New Delhi
I want to make a simple data entry application where the app starts with the main activity and asks the user for their info and image URI from the gallery, after getting all the inputs when the user enters submit it opens up a new activity that...
20 Mar 2023 by Fatema Shawki
I'm working on a real-time object detection mobile application using kotlin. I trained a yolo v5 model on a custom dataset of 4 classes, then converted the model to a .tflite file. I used this line to convert the yolo model to tflite: !python...
20 Mar 2023 by Richard MacCutchan
I suspect the problem may be the use of intArrayOf in the followibng line: val inputFeature0 = TensorBuffer.createFixedSize(intArrayOf(1, 640, 640, 3), DataType.FLOAT32) which suggests that you are passing an array of INT32 values (1, 640, 640...