Skip to content
Advertisement

Tag: kotlin

Wrong values from string empty test (java x kotlin)

I’m having a super weird behavior from a code that I was testing. The test I wrote was to see the behavior of the class if the Android returned an empty package name. After some debugging, I found this (consider that packageName is empty): Is this expected? Can someone tell what the deal with this? ps1.: In the picture above,

@Generated annotation using gradlew + dagger

I’m confronting a weird issue using gradlew(4.10.2) + dagger(2.18). The problem is when I call: The build fails with: Task :Common:compileDebugJavaWithJavac FAILED /CommonModule_ProvidesGsonFactory.java:6: error: package javax.annotation.processing does not exist import javax.annotation.processing.Generated; /CommonModule_ProvidesGsonFactory.java:8: error: cannot find symbol @Generated( But if I run the task from Android Studio, the task succeed and the @Generated is not present in the dagger generated class.

How to place a object without tapping on the screen

I am trying to show an object without tapping on the screen using ARCore. In the basic sample of ARCore Sceneform provided by Google, you need to tap on the screen after it detects the surface. I want to implement that, AR shows the object without tapping on the screen. I tried this for displaying without tapping on the screen.

How do I create a jar with all dependencies using Gradle 4.4?

This question is related to this one — however, due to the deprecation of compile in favor of implementation, it doesn’t work. It does pick up dependencies that are declared with compile. However, with it being deprecated, using it isn’t an option (and we’d be right back here when it’s removed anyway) I got this Gradle task: And there’s just

How do I replace multiple characters in a String?

How do I replace multiple characters in a String? Like Java’s replaceAll(regex:replacement:) function. This answer is very close but I want to change more than one character at the same time. Answer [$,.] is regex, which is the expected input for Java’s replaceAll() method. Kotlin, however, has a class called Regex, and string.replace() is overloaded to take either a String

Deserializing a list of ints with Spring WebClient

I’m trying to communicate with a Rest service that returns a simple JSON array of ints, e.g. I have the following code to make the call via WebClient: However, Spring returns me an empty Flux. If I replace the bodyToFlux call with a bodyToMono<List<Int>>, then Spring is able to deserialize the response as expected. The drawback being that I have

Advertisement