Category: Groovy
-
A Few Astronomical Examples in Kotlin
The website Open Notify provides a few URLs that return JSON data from NASA. There are currently three links supported: Number of people in space Current location of the International Space Station Overhead pass predictions for the ISS Just for fun, this blog post uses Kotlin to access each one, transform the results in Kotlin…
-
Days Between Dates in Java 8
I would like to address a problem that is quite topical at the moment: calculating the number of days between two events. The new Date-Time API in Java 8 makes this process much simpler than it used to be. The Date-Time API includes the interface java.time.temporal.TemporalUnit, which is implemented by the enum ChronoUnit in the…
-
Making Java 8 Groovier: A few annotated examples
In a couple of weeks, I’m giving two talks at talk at the 2016 JavaOne conference in San Francisco. One of them is called “Groovy and Java 8: Making Java Better“. I’m building examples in preparation for the conference, and as the Groovy community is good about correcting my errors in a friendly way, I…
-
Fun with Time Zones in Java 8
[Note: Revised based on suggestions in the comments.] They say that one way to identify a software developer is to whisper the word “timezone” in their ear and see if they shudder. That’s certainly true for me, though my reaction is based more on travel and trying to arrange conference calls across time zones than…
-
Excluding Gradle Tasks with a Name Pattern
I’ve been spending a lot of time with Gradle build files in Android projects, which probably isn’t a big surprise given that I’m working on a book called Gradle Recipes for Android (coming soon to all your better ebook stores and (who knows?) maybe an actual, physical bookstore somewhere (but probably not), but you can…
-
Retrofitting Groovy
I’m teaching an Android development class this week, and one of our primary references is the book Android 6 for Programmers, 3rd edition, which was released last December. One of the examples in the book accesses the Open Weather Map RESTful web service and builds a UI around the results, which is pretty much the…
-
A Groovy approach to npm-gate
Recently the JavaScript community experienced a serious disruption when a developer removed one of his deployed libraries from the central npm server, an event now being referred to as npm-gate. I don’t want to get into the various ethical, moral, or legal issues about that here. Rather, I want to show how trivially the missing functionality…
-
The Shadow Knows Gradle
Someone recently complained on Twitter that the so-called Shadow plugin for Gradle, written by the inestimable John Engleman, no longer worked on Gradle 2.11 or 2.12. Commenters were quick to point out that the latest version (1.2.3) of the plugin did work. I thought I’d put together this quick blog post to demonstrate that it…
-
Rough cut of Gradle Recipes for Android now available
My latest book, Gradle Recipes for Android, is now available as a “Rough Cut” at O’Reilly. You can get it at http://shop.oreilly.com/product/0636920032656.do. Rough cuts are preliminary versions of O’Reilly books, which are released while a book is still in progress, without special effort taken for formatting or anything else. In this case, however, the rough…
-
My father, at the end
Back May of 2010, my mother called to let me know that my father was going into the hospital for minor surgery. There was nothing to worry about, and no reason for me to drive all the way there just to see him, especially since he was only going to be in the hospital for…