AUTOMATED ANDROID
CONTINUOUS INTEGRATION:
HOW HARD CAN IT BE?
@NICOLAS_FRANKEL
ME, MYSELF AND I
@nicolas_frankel #springboot
2
 Backend Java Developer
• As consultant
HYBRIS, AN SAP COMPANY
3
@nicolas_frankel #springboot
THE EXISTING ORGANIZATION
Software Factory
Mobile
Dev Team
THE REAL ORGANIZATION
Software Factory
Mobile
Dev Team
THE EXISTING SITUATION
SOFTWARE INSTALL AUTOMATION
SOFTWARE INSTALL AUTOMATION
JENKINS JOB CONFIGURATION
 No central registry
• Stored in XML
• In each job’s folder
WHAT WE DID
Analyzed the config of an
existing job
Divided it into snippets
Created Puppet template for
each
Assembled and filled in
snippets through classes
WHAT WE DID
Creation of a Jenkins DSL in
Puppet
WHY FAIL?
Time-consuming
Error-prone
Fragile
• Implementation details
Reinventing the wheel
ALTERNATIVES
Jenkins Job Builder
• Part of OpenStack
• DSL that calls Jenkins API
• YAML configuration
SOFTWARE INSTALL AUTOMATION
DEPENDENCIES
THE CHALLENGE
ISSUES
1. Gradle Wrapper
2. Robolectric
3. Android
platforms/extra/add-ons
JENKINS GRADLE PLUGIN
GRADLE ISSUE
./gradlew xxx
GRADLE WRAPPER
Made of:
• A JAR
• A property
Downloads the required
version from the Internet
GRADLE-WRAPPER.PROPERTIES
distributionUrl=
https://services.gradle.org/distributions/g
radle-2.3-bin.zip
THE ROOT ISSUE
The proxy…
REQUIREMENT
Artifactory
Nexus
Simple Web Server?
UPDATED GRADLE-WRAPPER.PROPERTIES
distributionUrl=
https://intranet.mydomain.org/org/gradle/gr
adle-2.3-bin.zip
GRADLE ISSUE
./gradlew xxx
ROBOLECTRIC ISSUE
./gradlew test
AN ERROR!?
Error:Could not HEAD
'http://repo1.maven.org/maven2/org/robolectr
ic/robolectric-gradle-
plugin/0.12.0/robolectric-gradle-plugin-
0.12.0.jar'. Received status code 407 from
server: AuthorizedOnly
GRADLE.PROPERTIES
systemProp.http.proxyHost=mydomain.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=user
systemProp.http.proxyPassword=password
WTF!?... SAME ERROR
Y U ROBOLECTRIC?
public class RobolectricTestRunner {
protected DependencyResolver getJarResolver() {
if (dependencyResolver == null) {
if (Boolean.getBoolean("robolectric.offline")) {
String dependencyDir = System.getProperty(
"robolectric.dependency.dir", ".");
dependencyResolver = new LocalDependencyResolver(
new File(dependencyDir));
} else {
File cacheDir = new File(new File(
System.getProperty("java.io.tmpdir")), "robolectric");
if (cacheDir.exists() || cacheDir.mkdir()) {
Logger.info(
"Dependency cache location: %s", cacheDir.getAbsolutePath());
dependencyResolver = new CachedDependencyResolver(
new MavenDependencyResolver(), cacheDir, 60 * 60 * 24 * 1000);
} else {
dependencyResolver = new MavenDependencyResolver();
}
}
}
}
Y U ROBOLECTRIC?
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.robolectric</groupId>
<artifactId>robolectric-parent</artifactId>
<version>3.1-SNAPSHOT</version>
</parent>
<artifactId>robolectric</artifactId>
<dependencies>
...
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-ant-tasks</artifactId>
<version>2.1.3</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
Y U ROBOLECTRIC?
“Robolectric downloads a version of Android at runtime
that's built specifically for running tests. Each API level is
~40mb, so producing a single jar file that includes everything
would be prohibitive. All of the artifacts are available on
maven central under the coordinates:
org.robolectric:android-all. You can grab the API levels from
maven central and use them with offline mode.”
https://groups.google.com/forum/#!topic/robolectric/nJgHt
dbkpi8
Y U ROBOLECTRIC?
Uses a custom class loader
Either:
• Download dependencies
beforehand
• Override method
• Pass through proxy 
YOUR OWN TEST RUNNER
@Override
protected DependencyResolver getJarResolver() {
if (this.dependencyResolver == null) {
if (Boolean.getBoolean("robolectric.offline")) {
String cacheDir = System.getProperty(
"robolectric.dependency.dir", ".");
this.dependencyResolver =
new LocalDependencyResolver(
new File(cacheDir));
} else {
this.dependencyResolver = new MyResolver();
}
}
return this.dependencyResolver;
}
YOUR OWN RESOLVER
public class MyResolver
extends MavenDependencyResolver {
@Override
protected void configureMaven(
DependenciesTask task) {
RemoteRepository remoteRepository =
new RemoteRepository();
remoteRepository.setId("My Maven repo");
remoteRepository.setUrl(BuildConfig.NEXUS_URL);
task.addConfiguredRemoteRepository(
remoteRepository);
}
}
ROBOLECTRIC ISSUE
./gradlew test
ANDROID SDK ISSUE
android update sdk
ANDROID SDK ISSUE
android update sdk -u
Non interactive mode
2 ISSUES
Set the proxy
Accept license agreements
ANDROID SDK --HELP
Action "update sdk":
Updates the SDK by suggesting new platforms to install if available.
Options:
-f --force : Forces replacement of a package or its parts, even if
something has been modified.
-n --dry-mode : Simulates the update but does not download or install
anything.
--proxy-host: HTTP/HTTPS proxy host (overrides settings if defined)
-s --no-https : Uses HTTP instead of HTTPS (the default) for downloads.
-t --filter : A filter that limits the update to the specified types of
packages in the form of a comma-separated list of
[platform, system-image, tool, platform-tool, doc, sample,
source]. This also accepts the identifiers returned by
'list sdk --extended'.
-u --no-ui : Updates from command-line (does not display the GUI)
--proxy-port: HTTP/HTTPS proxy port (overrides settings if defined)
-p --obsolete : Deprecated. Please use --all instead.
-a --all : Includes all packages (such as obsolete and non-dependent
ones.)
WTF?!!?
Accepts proxy parameters
But no authentication…
SOLUTIONS (THANKS GOOGLE FOR NOTHING)
Environments variables
Specific credential file
Local proxy 
A WORKING SOLUTION: EXPECT
Linux binary
Originally for testing
purpose
Script input in regard to
output
(VERY) SIMPLE EXPECT SCRIPT
#!/usr/bin/expect
eval spawn jot -r 1 0 1
expect {
"0" {
puts "zero"
}
"1" {
puts "one"
}
}
THE “REAL” SCRIPT
#!/bin/bash
expect -d -c '
log_file /var/log/update-android.log
set timeout -1
spawn <%= @android_sdk_dir %>/tools/android -v update sdk -a -u -f --proxy-host
<%= @proxy_host %> --proxy-port <%= @proxy_port %> -t <%= @joined_packages %>
while {1} {
expect {
"Login:" {
send "<%= @proxy_user %>r"
}
"Password:" {
send "<%= @proxy_password %>r"
}
"Workstation:" {
send "r"
}
"Domain:" {
send "r"
}
-re ".*[y/n]:" {
send "yr"
}
}
}'
Handles the proxy
Handles license agreements
ANDROID SDK ISSUE
android update sdk -u
ANDROID CONTINUOUS INTEGRATION?
Not mature
• Lags behind “standard” Java
So time-consuming…
• But possible!
Q&A
@nicolas_frankel
48
http://blog.frankel.ch/
@nicolas_frankel
http://frankel.in/

More Related Content

PPTX
JavaLand - Integration Testing How-to
PPTX
2014 Joker - Integration Testing from the Trenches
PPTX
201502 - Integration Testing
PPTX
Java Day Kharkiv - Integration Testing from the Trenches Rebooted
PDF
Arquillian & Citrus
PDF
The Many Ways to Test Your React App
PPTX
Testing Java EE apps with Arquillian
PPTX
Jenkins Evolutions - JEEConf 2012
JavaLand - Integration Testing How-to
2014 Joker - Integration Testing from the Trenches
201502 - Integration Testing
Java Day Kharkiv - Integration Testing from the Trenches Rebooted
Arquillian & Citrus
The Many Ways to Test Your React App
Testing Java EE apps with Arquillian
Jenkins Evolutions - JEEConf 2012

What's hot (20)

PDF
Spring boot introduction
PDF
Introduction to Spring Boot
PDF
vJUG - The JavaFX Ecosystem
PDF
Testcontainers - Geekout EE 2017 presentation
PDF
REST APIs with Spring
PPTX
Introduction to spring boot
PPTX
Spring boot Introduction
PDF
Building a Spring Boot Application - Ask the Audience!
PPTX
Intro to JavaScript Tooling in Visual Studio Code
PPTX
Spring boot 3g
PPTX
Spring boot
PDF
Continuous Integration Testing in Django
PDF
Spring Boot Intro
PDF
Rediscovering Spring with Spring Boot(1)
PPTX
Spring Boot and REST API
PPTX
Introduction to Spring Boot
PDF
Visual studio performance testing quick reference guide 3 6
PPTX
Spring Boot Tutorial
PPTX
Spring boot
PDF
Node.js vs Play Framework
Spring boot introduction
Introduction to Spring Boot
vJUG - The JavaFX Ecosystem
Testcontainers - Geekout EE 2017 presentation
REST APIs with Spring
Introduction to spring boot
Spring boot Introduction
Building a Spring Boot Application - Ask the Audience!
Intro to JavaScript Tooling in Visual Studio Code
Spring boot 3g
Spring boot
Continuous Integration Testing in Django
Spring Boot Intro
Rediscovering Spring with Spring Boot(1)
Spring Boot and REST API
Introduction to Spring Boot
Visual studio performance testing quick reference guide 3 6
Spring Boot Tutorial
Spring boot
Node.js vs Play Framework
Ad

Viewers also liked (19)

PDF
Android Mobile Continuous Integration. UA Mobile 2016.
PPTX
Voxxed Days Ticino - Spring Boot for Devops
PPTX
Java Day Lviv - Spring Boot under the hood
PPTX
Jpoint - Refactoring
PPTX
Geecon - Improve your Android-fu with Kotlin
PPTX
GeeCON - Improve your tests with Mutation Testing
PPTX
GeeCon - Cargo Culting and Memes in Java
PDF
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
PPTX
Continuous delivery mobile application development
PPTX
Javentura - Spring Boot under the hood
PDF
Experitest-Infosys Co-Webinar on Mobile Continuous Integration
PPTX
Voxxed Days Belgrade - Spring Boot & Kotlin, a match made in Heaven
PPTX
Morning at Lohika - Spring Boot Kotlin, a match made in Heaven
PPTX
Spring IO - Spring Boot for DevOps
PPTX
Managing Continuous Delivery of Mobile Apps - for the Enterprise
PPTX
The Dark Side of Microservices
PPTX
I.T.A.K.E Unconference - Mutation testing to the rescue of your tests
PPTX
jDays - Spring Boot under the Hood
PPTX
DevExperience - The Dark Side of Microservices
Android Mobile Continuous Integration. UA Mobile 2016.
Voxxed Days Ticino - Spring Boot for Devops
Java Day Lviv - Spring Boot under the hood
Jpoint - Refactoring
Geecon - Improve your Android-fu with Kotlin
GeeCON - Improve your tests with Mutation Testing
GeeCon - Cargo Culting and Memes in Java
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Continuous delivery mobile application development
Javentura - Spring Boot under the hood
Experitest-Infosys Co-Webinar on Mobile Continuous Integration
Voxxed Days Belgrade - Spring Boot & Kotlin, a match made in Heaven
Morning at Lohika - Spring Boot Kotlin, a match made in Heaven
Spring IO - Spring Boot for DevOps
Managing Continuous Delivery of Mobile Apps - for the Enterprise
The Dark Side of Microservices
I.T.A.K.E Unconference - Mutation testing to the rescue of your tests
jDays - Spring Boot under the Hood
DevExperience - The Dark Side of Microservices
Ad

Similar to Riga Dev Day - Automated Android Continuous Integration (20)

PPTX
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
KEY
Django deployment with PaaS
PDF
OpenSCAP Overview(security scanning for docker image and container)
PPT
An introduction to maven gradle and sbt
ODP
eXo Platform SEA - Play Framework Introduction
PPT
Maven: Managing Software Projects for Repeatable Results
PDF
Plugin-based software design with Ruby and RubyGems
PPTX
Tutorial 1: Your First Science App - Araport Developer Workshop
PPT
Sbt, idea and eclipse
PDF
Play framework
PDF
OpenSCAP Overview(security scanning for docker image and container)
PPTX
20091112 - Mars Jug - Apache Maven
PDF
OpenShift for Java EE Developers
PDF
Omaha (Google Update) server
PDF
UKLUG 2012 - XPages, Beyond the basics
PPTX
PHP Dependency Management with Composer
PDF
Release with confidence
PDF
Automação do físico ao NetSecDevOps
PPT
Maven Introduction
PDF
An introduction to Apache Hive CI and QA
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Django deployment with PaaS
OpenSCAP Overview(security scanning for docker image and container)
An introduction to maven gradle and sbt
eXo Platform SEA - Play Framework Introduction
Maven: Managing Software Projects for Repeatable Results
Plugin-based software design with Ruby and RubyGems
Tutorial 1: Your First Science App - Araport Developer Workshop
Sbt, idea and eclipse
Play framework
OpenSCAP Overview(security scanning for docker image and container)
20091112 - Mars Jug - Apache Maven
OpenShift for Java EE Developers
Omaha (Google Update) server
UKLUG 2012 - XPages, Beyond the basics
PHP Dependency Management with Composer
Release with confidence
Automação do físico ao NetSecDevOps
Maven Introduction
An introduction to Apache Hive CI and QA

More from Nicolas Fränkel (20)

PPTX
SnowCamp - Adding search to a legacy application
PPTX
Un CV de dévelopeur toujours a jour
PPTX
Zero-downtime deployment on Kubernetes with Hazelcast
PDF
jLove - A Change-Data-Capture use-case: designing an evergreen cache
PPTX
BigData conference - Introduction to stream processing
PPTX
ADDO - Your own Kubernetes controller, not only in Go
PPTX
TestCon Europe - Mutation Testing to the Rescue of Your Tests
PPTX
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
PPTX
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
PPTX
JavaDay Istanbul - 3 improvements in your microservices architecture
PPTX
OSCONF Hyderabad - Shorten all URLs!
PPTX
Devclub.lv - Introduction to stream processing
PPTX
OSCONF Koshi - Zero downtime deployment with Kubernetes, Flyway and Spring Boot
PPTX
JOnConf - A CDC use-case: designing an Evergreen Cache
PPTX
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
PPTX
JUG Tirana - Introduction to data streaming
PPTX
Java.IL - Your own Kubernetes controller, not only in Go!
PPTX
vJUG - Introduction to data streaming
PPTX
London Java Community - An Experiment in Continuous Deployment of JVM applica...
PPTX
OSCONF - Your own Kubernetes controller: not only in Go
SnowCamp - Adding search to a legacy application
Un CV de dévelopeur toujours a jour
Zero-downtime deployment on Kubernetes with Hazelcast
jLove - A Change-Data-Capture use-case: designing an evergreen cache
BigData conference - Introduction to stream processing
ADDO - Your own Kubernetes controller, not only in Go
TestCon Europe - Mutation Testing to the Rescue of Your Tests
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
JavaDay Istanbul - 3 improvements in your microservices architecture
OSCONF Hyderabad - Shorten all URLs!
Devclub.lv - Introduction to stream processing
OSCONF Koshi - Zero downtime deployment with Kubernetes, Flyway and Spring Boot
JOnConf - A CDC use-case: designing an Evergreen Cache
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
JUG Tirana - Introduction to data streaming
Java.IL - Your own Kubernetes controller, not only in Go!
vJUG - Introduction to data streaming
London Java Community - An Experiment in Continuous Deployment of JVM applica...
OSCONF - Your own Kubernetes controller: not only in Go

Recently uploaded (20)

PPTX
Why 2025 Is the Best Year to Hire Software Developers in India
PDF
Top 10 Project Management Software for Small Teams in 2025.pdf
PDF
Cloud Native Aachen Meetup - Aug 21, 2025
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
PPTX
AI Tools Revolutionizing Software Development Workflows
PPTX
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
PPTX
Comprehensive Guide to Digital Image Processing Concepts and Applications
PPTX
Swiggy API Scraping A Comprehensive Guide on Data Sets and Applications.pptx
PPTX
Independent Consultants’ Biggest Challenges in ERP Projects – and How Apagen ...
PDF
SOFTWARE ENGINEERING Software Engineering (3rd Edition) by K.K. Aggarwal & Yo...
PDF
Ragic Data Security Overview: Certifications, Compliance, and Network Safegua...
PDF
Engineering Document Management System (EDMS)
PPTX
ESDS_SAP Application Cloud Offerings.pptx
PPTX
Foundations of Marketo Engage: Nurturing
PPTX
Beige and Black Minimalist Project Deck Presentation (1).pptx
PDF
Odoo Construction Management System by CandidRoot
PDF
Mobile App for Guard Tour and Reporting.pdf
PDF
What Makes a Great Data Visualization Consulting Service.pdf
PPTX
Streamlining Project Management in the AV Industry with D-Tools for Zoho CRM ...
PDF
Crypto Loss And Recovery Guide By Expert Recovery Agency.
Why 2025 Is the Best Year to Hire Software Developers in India
Top 10 Project Management Software for Small Teams in 2025.pdf
Cloud Native Aachen Meetup - Aug 21, 2025
Chapter 1 - Transaction Processing and Mgt.pptx
AI Tools Revolutionizing Software Development Workflows
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
Comprehensive Guide to Digital Image Processing Concepts and Applications
Swiggy API Scraping A Comprehensive Guide on Data Sets and Applications.pptx
Independent Consultants’ Biggest Challenges in ERP Projects – and How Apagen ...
SOFTWARE ENGINEERING Software Engineering (3rd Edition) by K.K. Aggarwal & Yo...
Ragic Data Security Overview: Certifications, Compliance, and Network Safegua...
Engineering Document Management System (EDMS)
ESDS_SAP Application Cloud Offerings.pptx
Foundations of Marketo Engage: Nurturing
Beige and Black Minimalist Project Deck Presentation (1).pptx
Odoo Construction Management System by CandidRoot
Mobile App for Guard Tour and Reporting.pdf
What Makes a Great Data Visualization Consulting Service.pdf
Streamlining Project Management in the AV Industry with D-Tools for Zoho CRM ...
Crypto Loss And Recovery Guide By Expert Recovery Agency.

Riga Dev Day - Automated Android Continuous Integration