12
www.immobilienscout24.de Continuously Break The Android GDG DevFest Berlin | 13.10.2011 | Hasan Hosgel

Continuously Break The Android

Embed Size (px)

DESCRIPTION

The talk gives an introduction to automatic Android application builds with continuous integration servers. It shares ImmobilienScout24's best practices and experiences on this topic.

Citation preview

Page 1: Continuously Break The Android

www.immobilienscout24.de

Continuously Break The Android

GDG DevFest Berlin | 13.10.2011 | Hasan Hosgel

Page 2: Continuously Break The Android

About me

Hasan Hoşgel (Hosgel)Twitter: @alosdevGithub: alosdevG+: Hasan Hosgel

Senior Developer @ImmobilienScout24

Mobile enthusiast, Man of action

Page 3: Continuously Break The Android

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

Continuous Integration

In software engineering, continuous integration (CI) implements continuous processes of applying quality control — small pieces of effort, applied frequently. Continuous integration aims to improve the quality of software, and to reduce the time taken to deliver it, by replacing the traditional practice of applying quality control after completing all development. (source: http://wikipedia.org)

Page 4: Continuously Break The Android

Reasons for Android

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

● faster iterations/ early response

● Error free compiling sourcecode on the SCM HEAD

● automated tests:UnitIntegrationSmokeTestMonkeyrunner

● using different hardware combinationsOS levelsdensity, resolution

● automated quality checks:Lint, Findbugs, Checkstyle, PMDCode coverage

Page 5: Continuously Break The Android

CI Server Jenkins

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

● Needed softwareJava development kitAndroid development kitJenkins

● If you are using Ubuntu use a 32-bit installation and install Xvfb (virtual frame buffer) for running the emulator

● For ant development Ant

● For Maven development Maven 3

● Install Android emulator Jenkins plugin

● SCM plugin

Page 6: Continuously Break The Android

Using ant as buildingsystem

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

● You don‘t have an ant file?android update project –p <path of the application project>android update test-project -m <path of the application project> -p <path of the test project>

● Create a free-style software project in Jenkins

● Configure SCM in Jenkins

● Configure your emulator (existing or create automatically)

● Add ant build step

missing dependency mamagement

official support

Page 7: Continuously Break The Android

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

Using maven as buildingsystem

● You don‘t have a maven project?http://www.androidbootstrap.com/

● Create a maven project in Jenkins

● Configure SCM in Jenkins

● Configure your emulator (existing or create automatically)

● Add maven commands

missing official support, is a XML-hell & complicated

dependency management & multi device support (install, run & test)

Page 8: Continuously Break The Android

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

Advanced & Best Practices

● Multi configuration (parameterised builds, matrix)Different screen sizesDifferent OS versionsDifferent packages, test size (annotations)

● Build chain (automatically) exampleCompilemain OS version: unit- & integration test (package)*, static code analyse & coverageMulti configuration: unit- & integration test (package)*package & signRelease to SCM (not play store)[probably you want it manually]

* Using large test suites

Page 9: Continuously Break The Android

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

What’s next?Gradle

● Gradle is an experimental new Android SDK build systemhttp://tools.android.com/tech-docs/new-build-system

● Dependency management

● Make it easy to create several variants of an application, multi apk distribution or different flavours of applications

● Filtering of resources & manifest (Maps key, signing, etc.)

● Actual version 0.2

a new build system

not finished yet (if you have knowledge, help the project!)

Page 10: Continuously Break The Android

Conclusion

Start continuous integration with a CI server

Write tests and run them automated

Continuously improve your work result & create amazing apps

Just do it!

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

Page 11: Continuously Break The Android

Dive Into Topic & Sources

Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel

● slidesharehttp://www.slideshare.net/hosgel/continuously-break-theandroid

● Jenkinshttp://jenkins-ci.org/

● Android Developerhttp://developer.android.com/

● Maven Android pluginhttp://code.google.com/p/maven-android-plugin/ http://www.androidbootstrap.com/

● Gradlehttp://www.gradle.org/ http://tools.android.com/tech-docs/new-build-system

Page 12: Continuously Break The Android

http://karriere.immobilienscout24.de

We are searching for new colleagues!contact:Immobilien Scout GmbHAndreasstraße 1010243 Berlin

Hasan HosgelTwitter alosdevGithub alosdev