Understanding Groovy
As most Android developers are proficient Java developers, it is interesting to look at how Groovy works compared to Java. Groovy is quite easy to read if you are a Java developer, but writing your own Groovy code would be a hard task without a small introduction.
Tip
A good way to experiment with Groovy is to use the Groovy Console. This application comes with the Groovy SDK and makes it easy to try out Groovy statements while getting an immediate response. The Groovy Console is also able to handle pure Java code, which makes it easy to compare Java and Groovy code. You can download the Groovy SDK, including the Groovy Console, from the Groovy website at http://groovy-lang.org/download.html.
Introduction
Groovy is derived from Java and runs on the Java Virtual Machine. Its goal is to be a simpler, more straightforward language that can be used either as a scripting language or as a full-blown programming language. Throughout this section, we will compare Groovy with Java...