www.immobilienscout24.de




Continuously Break The
Android
GDG DevFest Berlin | 13.10.2011 | Hasan Hosgel
About me
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)




                                 Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
Reasons for Android


●   faster iterations/ early response
●   Error free compiling sourcecode on the SCM HEAD
●   automated tests:
       Unit
       Integration
       SmokeTest
       Monkeyrunner
●   using different hardware combinations
       OS levels
       density, resolution
●   automated quality checks:
       Lint, Findbugs, Checkstyle, PMD
       Code coverage


                            Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
CI Server Jenkins


●   Needed software
        Java development kit
        Android development kit
        Jenkins
●   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




                              Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
Using ant as buildingsystem


●   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



                             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)


                             Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
Advanced & Best Practices


●   Multi configuration (parameterised builds, matrix)
       Different screen sizes
       Different OS versions
       Different packages, test size (annotations)
●   Build chain (automatically) example
       Compile
       main OS version: unit- & integration test (package)*, static code
       analyse & coverage
       Multi configuration: unit- & integration test (package)*
       package & sign
       Release to SCM (not play store)[probably you want it manually]



* Using large test suites

                             Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
What’s next?
Gradle

●   Gradle is an experimental new Android SDK build system
        http://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!) 



                              Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
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
Dive Into Topic & Sources


●   slideshare
        http://www.slideshare.net/hosgel/continuously-break-theandroid
●   Jenkins
        http://jenkins-ci.org/
●   Android Developer
        http://developer.android.com/
●   Maven Android plugin
        http://code.google.com/p/maven-android-plugin/
        http://www.androidbootstrap.com/
●   Gradle
        http://www.gradle.org/
        http://tools.android.com/tech-docs/new-build-system



                            Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
http://karriere.immobilienscout24.de


We are searching for new
colleagues!
contact:
Immobilien Scout GmbH                  Hasan Hosgel
Andreasstraße 10                       Twitter alosdev
10243 Berlin                           Github alosdev

Continuously Break The Android

  • 1.
    www.immobilienscout24.de Continuously Break The Android GDGDevFest Berlin | 13.10.2011 | Hasan Hosgel
  • 2.
  • 3.
    Continuous Integration In softwareengineering, 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) Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
  • 4.
    Reasons for Android ● faster iterations/ early response ● Error free compiling sourcecode on the SCM HEAD ● automated tests: Unit Integration SmokeTest Monkeyrunner ● using different hardware combinations OS levels density, resolution ● automated quality checks: Lint, Findbugs, Checkstyle, PMD Code coverage Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
  • 5.
    CI Server Jenkins ● Needed software Java development kit Android development kit Jenkins ● 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 Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
  • 6.
    Using ant asbuildingsystem ● 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 Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
  • 7.
    Using maven asbuildingsystem ● 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) Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
  • 8.
    Advanced & BestPractices ● Multi configuration (parameterised builds, matrix) Different screen sizes Different OS versions Different packages, test size (annotations) ● Build chain (automatically) example Compile main OS version: unit- & integration test (package)*, static code analyse & coverage Multi configuration: unit- & integration test (package)* package & sign Release to SCM (not play store)[probably you want it manually] * Using large test suites Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
  • 9.
    What’s next? Gradle ● Gradle is an experimental new Android SDK build system http://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!)  Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
  • 10.
    Conclusion Startcontinuous 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
  • 11.
    Dive Into Topic& Sources ● slideshare http://www.slideshare.net/hosgel/continuously-break-theandroid ● Jenkins http://jenkins-ci.org/ ● Android Developer http://developer.android.com/ ● Maven Android plugin http://code.google.com/p/maven-android-plugin/ http://www.androidbootstrap.com/ ● Gradle http://www.gradle.org/ http://tools.android.com/tech-docs/new-build-system Continuously Break The Android | GDG DevFest Berlin | Hasan Hosgel
  • 12.
    http://karriere.immobilienscout24.de We are searchingfor new colleagues! contact: Immobilien Scout GmbH Hasan Hosgel Andreasstraße 10 Twitter alosdev 10243 Berlin Github alosdev