Questions tagged as 'kotlin'

1
answer

Why use the "is" variable beginning in Kotlin?

What is the reason for using is in front of the variable. Example source code. I know it has something to do with set . class Rectangle( val height: Int, val width:Int) { val IsSquare: Boolean get(){ return height...
asked by 26.11.2017 / 17:06
1
answer

What does the === operator in Kotlin mean?

What does the Kotlin === operator mean, and how to use it? I found this snippet of code in the documentation, but I was not sure. val boxedA: Int? = a val anotherBoxedA: Int? = a println(boxedA === anotherBoxedA) // !!!Prints 'false'!!!     
asked by 04.12.2018 / 14:18
1
answer

How to make two Retrofit calls in jail with RxJava?

I make a call to retrieve some data and the second call - which should be done within the first - uses one of the fields of the previous call. val restApi = retrofit.create(RestAPI::class.java) testAPI.searchDoc("language", "title_query")...
asked by 12.12.2017 / 00:12
2
answers

Kotlin for creation and APIs: is it only for Android?

I saw some features offered by the Kotlin tool, even more so when it comes to saving lines of code and verbosity generated in Java. How is the tool for generating services and consumed by Web applications? Like Angular 2+, for example ... Wou...
asked by 12.11.2018 / 04:38
1
answer

Error: 'classifier' class name 'does not have a companion object,' [closed]

My code fun main(args: Array<String>) { val listaDeLikes = listOf( RelacaoDeLike(323423,1), //Usuario 323423 deu like no post 1 RelacaoDeLike(234234,1), //Usuario 234234 deu like no post 1 RelacaoDeLike(45645...
asked by 23.10.2017 / 17:46
2
answers

findViewById in Kotlin

I was generating an action by clicking on a Button fun cliqueBotao(view : View){ var texto = findViewById<>(R.id.textoExibicao) as TextView texto.setText("Texto alterado") } Only Android Studio complained that findVi...
asked by 07.01.2018 / 01:14
2
answers

Is it worth measuring performance between Java x Kotlin application?

By moving to the Google Developers documentation, I found something really cool like: Measuring app performance with Android Profiler But knowing that Java and Kotlin are interpreted by the JVM, I believe that the difference in performance...
asked by 23.05.2018 / 01:23
2
answers

I can not use class R. in kotlin

I'm trying to learn kotlin , but I'm not able to import the class "R." no kotlin   Would anyone know to tell me what I'm doing wrong?     
asked by 03.01.2018 / 16:00
1
answer

Is it possible to export a JAR file with only Kotlin classes, without any Java class?

I'm using Intellij IDEA to develop a project in Kotlin, and I've reached a point where I need to create an executable file to run on the server, but when I try to create a JAR Artifact , , something that does not exist in the projec...
asked by 21.11.2017 / 20:49
0
answers

Error: Debug variables info not available [closed]

Whenever I try to "debug" with Android Studio this error appears: "debug variables info not available". Code in gradle: apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' andr...
asked by 30.10.2017 / 20:15