Questions tagged as 'kotlin'

0
answers

Plugin to create variable instance constructor at runtime

I need to create some tests using variables already instantiated at runtime, and instead of manually mounting, object by object, attribute by attribute, I would like some tool that automates itself and already brings code with objects and variab...
asked by 24.08.2018 / 16:11
0
answers

Problem in creating unit test android with RxJava and Mockito

The test comes down to making the assertions that the methods are called when the execution is done successfully, but an error is occurring that I can not resolve. My class: class LoginActivityPresenter(private var authUseCase: AuthStruct...
asked by 03.08.2018 / 13:52
1
answer

Convert TripleDESCryptoServiceProvider to javax.crypto.Cipher

I need to convert a VB encryption method to Kotlin, however the results are giving different. In vb it is implemented as follows: Public Shared Function MD5Hash(ByVal value As String) As Byte() Dim byteArray() As Byte = ASCIIEncoding.ASCII...
asked by 20.06.2018 / 21:02
0
answers

What am I doing wrong when using LET (Kotlin)?

I'm using retrofit and in onReaponse, when I try to get body information with (Let), the internal code does not execute. response?.body()?.let { Log.i("Info", "Cidades: " + it.size) } If you try like this, it also does not work: respons...
asked by 09.07.2018 / 15:14
0
answers

How to receive messages from firebase console in android in the background?

I have an app that sends notifications from the firebase console and my notifications do not arrive on the phone when they are in the background but when they are in the foreground with the app open the notification arrives normally. I would app...
asked by 15.06.2018 / 13:47
0
answers

Reflections with Kotlin [closed]

I need to compare a KParameter with a KClass, know if the parameter type is equivalent to my KClass. So far I have not found a saint to do this, does anyone have my solution?     
asked by 11.05.2018 / 06:10
0
answers

Difference between method and function? [duplicate]

Because in Java it is called a method and in Kotlin it is called a function, it is just a different nomenclature, or is there any significant difference? Java: public class Teste { public static void main(String[] args) { int re...
asked by 09.05.2018 / 14:34
2
answers

Problems handling Vector Asset

Android Studio is returning this error when I add images to my project, but the selected images are the IDE's native icons.     
asked by 22.01.2018 / 17:50
0
answers

How to have a searchview of material design?

I need to have a toolbar with the menu items inside, search icon and voice. Like this one from the image: IhavetheactivitycodeoverridefunonCreateOptionsMenu(menu:Menu):Boolean{menuInflater.inflate(R.menu.menu_home,menu)returnsuper.onCreateOp...
asked by 20.12.2017 / 16:22
1
answer

Performance Kotlin vs java and is it worth exchanging java for Kotlin?

The running performance in android (I mean the speed of the application and not the speed of compilation, since benchmarks in powerful machines showed kotlin slower than java in terms of compilation) of kotlin is faster and efficient? / p> I'v...
asked by 09.01.2018 / 18:54