SlideShare a Scribd company logo
Dominik Helleberg | inovex GmbH
Auf Augenhöhe mit Android
Studio und Gradle
Dominik Helleberg
Mobile Development
Android / Embedded
Tools
http://dominik-helleberg.de/+
Android Studio!
!
!
Gradle +!
Android Plugin!
or!
„The new build system“
The new Dream Team!
new?!
Oktober !
2012
Mai!
2013
https://plus.google.com/u/0/+XavierDucrohet/posts/XnW7t9XJCMJ!
ready?!
Version!
0.9.+
Version!
0.5.1
Android PlugIn
Android Designer
Android PlugIn
Android DDMS
Android Builder
.properties
build.xml
Android PlugIn
Android Designer
Android PlugIn
Android Gradle Adapter
.properties
build.gradle
Android Studio und gradle
Best of ANT / Maven / GANT / Ivy!
Based on Groovy Scripts!
Expressive DSL !
(Flexible) Convention over Configuration!
Easy to extend!
!
„Make the impossible possible, make the possible
easy and make the easy elegant.” !
!
!
„hello groovy & gradle“!
!
Code!
distcompile
compileTest test
3 Phasen:!
Initialization!
Configuration!
Execution!
!
Android Studio und gradle
apply plugin: 'android'!
!
android {!
compileSdkVersion 19!
buildToolsVersion "19.0.2"!
!
defaultConfig {!
minSdkVersion 7!
targetSdkVersion 19!
versionCode 1!
versionName "1.0"!
}!
buildTypes {!
release {!
runProguard false!
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.txt'!
}!
}!
}!
!
dependencies {!
compile 'com.android.support:appcompat-v7:+'!
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])!
}!
Android PlugIn 0.9.+!
Core Features!
!
•  Konfigurierbare Manifest Attribute!
•  Build Varianten !
•  Tests integriert!
•  BuildConfig konfigurierbar!
•  Signierung konfigurierbar!
•  Tools versioniert!
•  Multiproject-Support!
•  Dependency Management!
•  Binary Lib Format (AAR)!
•  Lint integration!
•  Dex + AAPT Options!
apply plugin: 'android'!
!
android {!
compileSdkVersion 19!
buildToolsVersion "19.0.2"!
!
defaultConfig {!
minSdkVersion 7!
targetSdkVersion 19!
versionCode 1!
versionName "1.0"!
}!
buildTypes {!
release {!
runProguard false!
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.txt'!
}!
}!
}!
!
dependencies {!
compile 'com.android.support:appcompat-v7:+'!
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])!
}!
Demo PlugIn!
Build targets!
Variants!
!
Code!
Android PlugIn 0.9.+!
Extension:!
Automatische Versions-Verwaltung!
Ziel:!
"Version Code!
"Version Name!
"- einfach konfigurierbar halten!
"- aus git-tags extrahieren und in gradle setzen!
"!
"Build-Informationen in der App verfügbar machen!
!
!
Android PlugIn 0.9.+!
Automatische Versions-Verwaltung!
Schritt 1:!
!
Build-Informationen in App anzeigen !
!
" "Build-Time!
" "Build-Host!
"!
über BuildConfig!
Android PlugIn 0.9.+!
Automatische Versions-Verwaltung!
Schritt 2:!
!
Konfiguration von !
!
" "Version Code!
" "Version Name!
"!
über eine Property-Datei!
Android PlugIn 0.9.+!
Automatische Versions-Verwaltung!
Schritt 3:!
!
Berechnung von versionCode und versionName!
!
"version=2.1.3!
!
"versionCode=2130!
"VersionName=2.1.3!
Android PlugIn 0.9.+!
Automatische Versions-Verwaltung!
Schritt 4:!
!
Versionsnummer aus git Tag auslesen!
!
" "git-Tag „2.1.3“!
!
Android PlugIn 0.9.+!
Automatische Versions-Verwaltung!
Schritt 5:!
!
Versionsnummer + App Name dem APK hinzufügen!
!
<name>-<sub-name>-<buildType>-<version>.apk!
Android PlugIn 0.9.+!
Automatische Versions-Verwaltung!
Modularisieren:!
!
inside build-scripts!
!
buildSrc/!
!
external build-scripts (local file or http)!
apply from:'https://raw.github.com/../all-jars.gradle‘!
apply from:'~/.gradle/RobertFischer/gradle-scripts/all-jars.gradle‘!
!
via dependencies / Repository!
Android PlugIn 0.9.+!
Android Studio und gradle
Key Features!
Build Variants!
BuildTypes!ProductFlavour!
debug!
UAT!
release!
int!
ext!
Builds!
int-debug!
ext-debug!
int-UAT!
ext-UAT!
int-release!
ext-release!
Key Features!
Build Variants!
Demo Android Studio!
Key Features!
The „old“ World!
Key Features!
Build Variants Directory structure!	
  
	
  
src/	
  
	
  int/	
  
	
   	
  java/	
  
	
   	
  res/	
  
	
  ext/	
  
	
   	
  java/	
  
	
   	
  res/	
  
	
  main/	
  
	
   	
  java/	
  
	
   	
  res/	
  
	
  
	
  androidTest/	
  
	
   	
   	
  	
  	
  	
  	
  java/	
  
Key Features!
•  Layout Editor!
•  IntelliJ Features!
•  Improved Checks!
•  Improved UI!
!
!
!
Status Quo!
•  Mostly stable but
expect breaking changes!
•  Documentation poor!
•  Many examples might not
work (old versions)!
•  Features are worth
considering it
•  Mostly stable!
•  Unpredictable updates!
•  Tools & Features
missing!
•  IntelliJ EAP Release
Empfehlung!
•  „I‘m feeling lucky“!
•  Multiproject-Builds!
•  Safe side: stay with eclipse (but maybe use gradle)!
•  Gradle will be mandatory / Android Studio is optional!
!
!
Tipps + Tricks!
http://www.manning.com/muschko/
Tipps + Tricks!
Gradle daemon
$>	
  cat	
  .gradle/gradle.properties	
  
	
  	
  	
  org.gradle.daemon=true	
  
	
  
Show dependencies
$>	
  gradle	
  dependencies	
  
	
  
Tipps + Tricks!
Gradle Init Scripts
$>	
  cat	
  .gradle/init.gradle	
  
initscript	
  {	
  
	
  	
  	
  	
  allprojects	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  apply	
  plugin:	
  'maven’	
  
	
  	
  	
  	
  	
  	
  	
  	
  repositories	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  maven	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  url	
  =	
  "http://archiva.inovex.de:8080/archiva/
repository/snapshots/"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  }	
  
}	
  
$>	
  gradle	
  assembleDebug	
  -­‐-­‐profile	
  
DANKE!

More Related Content

KEY
Whats New in Android
PDF
An iOS Developer's Perspective on React Native
PDF
Experiences building apps with React Native @DomCode 2016
PDF
Mobile Applications
PDF
Testing Ginormous JavaScript Apps - ScotlandJS 2014
PPTX
React Native - Why Designers should use React native. And everyone else too.
PDF
React native in the wild @ Codemotion 2016 in Rome
PPTX
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
Whats New in Android
An iOS Developer's Perspective on React Native
Experiences building apps with React Native @DomCode 2016
Mobile Applications
Testing Ginormous JavaScript Apps - ScotlandJS 2014
React Native - Why Designers should use React native. And everyone else too.
React native in the wild @ Codemotion 2016 in Rome
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?

What's hot (19)

PPTX
Rapid mobile development with Ionic framework - Voxxdays Ticino 2015
PDF
Ionic - Revolutionizing Hybrid Mobile Application Development
PPTX
How to Give a Successful Lightning Talk
PDF
Building Mobile Applications with Ionic
PPTX
Android Primer - LEX >> FWD
PDF
Intro to react native
PDF
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
PDF
Optimizing React Native views for pre-animation
PDF
Blog for the price of a domain
PPT
Selenium and Cucumber Selenium Conf 2011
DOCX
Calabash my understanding
PDF
When to (use / not use) React Native.
PDF
GWT Architectures and Lessons Learned (WJAX 2013)
PPT
Intro to jQuery - LUGOR - Part 1
PDF
Testing Angular Applications - Jfokus 2017
PPTX
React Native
PPT
jQuery For Developers Stack Overflow Dev Days Toronto
PPT
Intro to jQuery
PDF
React native-meetup-talk
Rapid mobile development with Ionic framework - Voxxdays Ticino 2015
Ionic - Revolutionizing Hybrid Mobile Application Development
How to Give a Successful Lightning Talk
Building Mobile Applications with Ionic
Android Primer - LEX >> FWD
Intro to react native
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
Optimizing React Native views for pre-animation
Blog for the price of a domain
Selenium and Cucumber Selenium Conf 2011
Calabash my understanding
When to (use / not use) React Native.
GWT Architectures and Lessons Learned (WJAX 2013)
Intro to jQuery - LUGOR - Part 1
Testing Angular Applications - Jfokus 2017
React Native
jQuery For Developers Stack Overflow Dev Days Toronto
Intro to jQuery
React native-meetup-talk
Ad

Viewers also liked (13)

PDF
Android Development Tools
PDF
Why do we need more nerds?
PDF
Android Studio vs. ADT
PDF
One APK to rule them all
PDF
Android Ice Cream Sandwich WJAX 2011
PDF
Embedded Android
PDF
Supercharge your ui
PDF
Android ActionBar Navigation reloaded
PDF
Android Development Tools
PDF
Renderscript in Android 3.x
PPTX
Android Enterprise Integration
PDF
Core Android
PDF
Rich Graphics & OpenGL mit Android
Android Development Tools
Why do we need more nerds?
Android Studio vs. ADT
One APK to rule them all
Android Ice Cream Sandwich WJAX 2011
Embedded Android
Supercharge your ui
Android ActionBar Navigation reloaded
Android Development Tools
Renderscript in Android 3.x
Android Enterprise Integration
Core Android
Rich Graphics & OpenGL mit Android
Ad

Similar to Android Studio und gradle (15)

PDF
Moderne Android Builds mit Gradle
PDF
Entwicklung mit Android Studio und Gradle
PPTX
Gradle and Android Studio : Best of Friends
PDF
Android gradle-build-system-overview
PPTX
Android Studio簡介
PPTX
Android Studio vs Eclipse: What are the main differences?
PPTX
Using Android Studio and Genymotion for improved productivity
PPTX
Gradle,the new build system for android
PDF
Intro to Gradle + How to get up to speed
PDF
Gradle-based Android Build System
PDF
[DEPRECATED]Gradle the android
PPTX
Android studio&Gradle&Autotest
PDF
Hands on the Gradle
PDF
Gradle presentation
PDF
Android studio
Moderne Android Builds mit Gradle
Entwicklung mit Android Studio und Gradle
Gradle and Android Studio : Best of Friends
Android gradle-build-system-overview
Android Studio簡介
Android Studio vs Eclipse: What are the main differences?
Using Android Studio and Genymotion for improved productivity
Gradle,the new build system for android
Intro to Gradle + How to get up to speed
Gradle-based Android Build System
[DEPRECATED]Gradle the android
Android studio&Gradle&Autotest
Hands on the Gradle
Gradle presentation
Android studio

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
August Patch Tuesday
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Encapsulation theory and applications.pdf
Zenith AI: Advanced Artificial Intelligence
Programs and apps: productivity, graphics, security and other tools
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Heart disease approach using modified random forest and particle swarm optimi...
August Patch Tuesday
gpt5_lecture_notes_comprehensive_20250812015547.pdf
WOOl fibre morphology and structure.pdf for textiles
SOPHOS-XG Firewall Administrator PPT.pptx
TLE Review Electricity (Electricity).pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Unlocking AI with Model Context Protocol (MCP)
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
NewMind AI Weekly Chronicles - August'25-Week II
OMC Textile Division Presentation 2021.pptx
Getting Started with Data Integration: FME Form 101
A comparative study of natural language inference in Swahili using monolingua...
MIND Revenue Release Quarter 2 2025 Press Release
Assigned Numbers - 2025 - Bluetooth® Document
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...

Android Studio und gradle