Android and Jenkins: Continuous Integration

By using Jenkins, it’s pretty easy to get a Continuous Integration server set up with an Android project. But before you dive into setting up the software itself, it’s very helpful to have some basic concepts on a few different types of software that you will run into.

For those unaware, Continuous Integration is a way to improve your code by following the “fail fast” concept. If any bug or problem crops up in your application, you want to find them as early as possible. By building and testing your application frequently, you can do just that. By finding the bug quickly, it will be easier to fix the problem, as the code was written recently.

What CI really does for you is two things:

  1. Compiles the application when any new changes are checked in
  2. Runs automated tests every time we recompile

So CI is really only helpful if you are growing your Unit Tests as well as your application. Without the tests to support your application, Continuous Integration quickly loses its usefulness.

Jenkins is really an automated build server for a number of different types of applications. Jenkins itself is written in Java, so it’s only natural for it to support Java projects at its core, which works out great for Android.

Jenkins Plugins

One of the really awesome things about Jenkins is it’s plugin capability. Jenkins alone can pull your software (from SVN) and build it, if you’re a Java project, but that’s really it. By adding a few plugins, you can add some more interesting and useful features. Without a handful of plugins, using Jenkins as a CI server wouldn’t be possible.

For Android, these two Jenkins plugins are incredibly useful:

  • Android Emulator
    • Allows automated unit testing using the emulator
  • xUnit
    • Improves the basic jUnit support of Jenkins


Ant

When using Jenkins, some basic knowledge of Ant is also necessary. If you’re building Android projects with Eclipse, you likely don’t ever deal with the configuration that is required to build your application. With Jenkins, you have to do a bit of work to get it building properly by creating an Ant script for your app.

I won’t go into the details of actually creating an Ant script. You can find more info. on Ant from the above link, and this blog post helps immensely when generating the script from scratch.

Unit Testing

Robodium is a framework that beefs up Android Unit Test capabilities. It allows much easier testing of UI elements within Android. If you are looking to write unit tests for your application, you should really check it out.

I hope this article helps you get the basics of what’s really needed for an Android CI server using Jenkins. To get into the details to truly set the server up, check out this blog article:

Don’t forget to share!

Reference: Android and Jenkins: Continuous Integration from our JCG partner Isaac Taylor at the Programming Mobile blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

Leave a Reply


− two = 3



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close