Most developers use Eclipse as their IDE of choice for Android development. Google provides the ADT (Android Developer Tools) plugin for Eclipse that simplifies the process of setting up new Android projects and going about development.
However, when setting up Continuous Integration for Android projects, we would need to build outside the IDE. The Android SDK is bundled with various command line tools to help us build Android projects. Ant is one tool which lets us compile and build the project into an installable .apk file.
The process of building Android apps using Ant is best illustrated by the description in the official documentation:
There are two ways to build your application using the Ant build script: one for testing/debugging your application — debug mode — and one for building your final package for release — release mode. Regardless of which way you build your application, it must be signed before it can install on an emulator or device—with a debug key when building in debug mode and with your own private key when building in release mode.
When it comes to Continuous Integration tools we prefer to use Atlassian Bamboo because it goes beyond build automation and has amazing features ranging from numerous built-in and third party tasks to seamless integration with Atlassian JIRA allowing users to assign issues right from the build result page. Also, Addteq is an Atlassian partner and we practice what we preach when it comes to developer tools!
For an Android project that we are working on, we wanted to setup Bamboo to provide the developers rapid feedback about any changes happening in the project. With Android SDK’s built-in support for Ant and Bamboo’s ease of use, we were able to quickly setup a build pipeline by following the anatomy of a typical Bamboo build.
We have a build stage that consists of tasks to get the latest changes to the project’s Git repository (Which is managed using Atlassian Fisheye but we will save the details for a future blog post!), execute the Ant script to compile the source code and create the APK package as well as generate the API documentation in HTML using Javadoc. To generate the javadoc we added a target to the build script and utilized Ant’s javadoc task. The build script also copies the generated javadocs to Apache web server’s default Document Root so that developers can access it from //bamboo-host/javadocs
We have a second stage that runs various kinds of static code analysis tools for Java: Checkstyle and PMD.
We also utilize Bamboo’s feature of running parallel jobs within a stage.
Bamboo also allowed for sending of immediate feedback of the build results via email notifications to developers. The project manager was also able to create JIRA issues by assigning responsibility for build failures; and the developers themselves were also able to claim responsibility.
We loved every minute of using Bamboo to setup our Android deployments. You can learn more about Bamboo by visiting Atlassian’s website.
Want to know more?
At Addteq we are official experts in Atlassian tools and highly competent in the arena of software configuration management. We’d love to help you answer any questions you may have. You can learn more about who are and what we do by visiting us at www.addteq.com.