Sunday, September 22, 2013

Android Studio - Early Access Preview v0.2.9

Following on from my post on Friday about Gradle. I decided to get started with the Early Access Preview of Android Studio (v0.2.9). My Android Call Location project has been dormant for some time so it's the perfect opportunity to try out the new tools whilst also updating the project to work with the more recent Android API.

So far I'm very impressed with the integration between the Android SDK and Intellij IDEA. It only took a few minutes to get my project working in an emulated Nexus 4.


Friday, September 20, 2013

How To: Add Gradle support to a Maven project

In 2010 I started working on Confluence/Jira Plugins (written in Java) for Adaptavist. My programming experience back then consisted of small projects with little or no dependencies and no automated tests, so landing a job at a software company was a big eye opener. It was during this time that I was introduced to Maven. Having the ability to define a projects dependencies and build process so that any other developer can easily compile the same project without needing to waste time configuring their dev environment is certainly a big win. It made a huge impression on me and I have been an advocate of Maven ever since.

While working at Adaptavist I had the good fortune to attend Devoxx in Belgium. During the conference I heard about Gradle but didn't pay it much mind as my day to day work was so geared around a specific set of tools. Since that time I've been involved in a few Android projects. Although there is an android-maven-plugin, I found trying to build Android projects using Maven considerably painful; this is due partly to the fact that an Android project structure does not fit well with the conventions that Maven uses.
"Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build"
Recently I came across this page showing the progress of Gradle support in the Android SDK. This prompted me to do a little reading about Gradle to see if it could help make Android development a little less troublesome. Starting with the android.com why Gradle page, and some good presentations on youtube I decided to download and install the latest version (1.7 at time of writing).

Installation is easy, just the same as Maven and most other tools. Set an environment variable called GRADLE_HOME and then make sure %GRADLE_HOME%\bin is on your PATH variable (same kind of thing for Linux & Mac). Once that's done just run 'gradle -v' from the command line to make sure it's setup correctly.

Thankfully the Gradle developers have made it easy for people to add Gradle support to existing Maven projects. In the root folder of your project just run 'gradle setupBuild' and Gradle will detect your pom file and create a 'build.gradle' file using the same dependencies and build settings.

Wednesday, September 18, 2013

How To: Install Quake 3 Arena on Ubuntu

This evening I wiped my old Belinea b.book 2.1 laptop and installed Ubuntu 13.04 on it. I wanted to have at least one game on it so I settled on Quake 3 as the machine is a little old. To install Quake 3 you need to have 'pak0.pk3' from the original installation. Then it's simply a case of running the following commands:
sudo apt-get install quake3 game-data-packager
wget ftp://ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-1.32b-3.x86.run
game-data-packager quake3 /path/to/pak0.pk3 /path/to/linuxq3apoint-1.32b-3.x86.run
sudo dpkg -i quake3-data_30_all.deb


My laptop resolution is 1280 x 800 (16:10) so to get Quake3 making full use of my screen I needed to edit the q3config.cfg file:
vim ~/.q3a/baseq3/q3config.cfg
Then set the following:
seta r_mode "-1"
seta r_customwidth "1280"
seta r_customheight "800"