javacodegeeks.com

Restart Android Activity with ActivityScenario

I was writing an instrumentation test which required restarting the activity during a test. As I was trying out the ActivityScenarioRule to replace an ActivityTestRule, the documentation says I can use this method on the ActivityScenario to restart the activity after it has been launched:1scenario.recreate()So I wrote this function to for restarting the activity:[email protected]    @JvmField var rule = ActivityScenarioRule(MyActivity::class.java)

javacodegeeks.com

Gradle Dependencies for Java, use compile or implementation?

While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of the examples were using the compile configuration for dependencies, while others were using implements and api.dependencies { compile 'commons-httpclient:commons-httpclient:3.1' compile 'org.apache.commons:commons-lang3:3.5' }dependencies { api 'commons-httpclient:commons-httpclient:3.1' implementation 'org.apache.commons:commons-lang3:3.5' }This

javacodegeeks.com

JRebel for a Gradle Spring Boot App

There is some documentation on how to add JRebel to a Spring Boot app that uses Gradle as the build tool. It is basic but works fine.All you have to do is to add a few lines to build.gradle:if (project.hasProperty('rebelAgent')) { bootRun.jvmArgs += rebelAgent }Then set the property in gradle.properties:rebelAgent=-agentpath:[path/to/JRebel library]However there are several ways to improve on this.