Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Gradle and Android Studio
Search
Fede
September 25, 2014
Programming
130
0
Share
Gradle and Android Studio
Info and tips of Gradle and Android Studio
Fede
September 25, 2014
More Decks by Fede
See All by Fede
Spark Streaming Tips for Devs & Ops
fedefernandez
0
99
Scala on Android - The current state of affairs
fedefernandez
0
46
Functional Views on Android
fedefernandez
0
610
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
200
Modding RubyKaigi for Myself
yui_knk
0
440
バックエンドにElysiaJSを採用して気付いた、良い点・悪い点
wanko_it
1
180
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1k
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
140
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.1k
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.7k
誰も頼んでない機能を出荷した話
zekutax
0
140
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.1k
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
300
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
280
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
570
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.3k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Speed Design
sergeychernyshev
33
1.7k
The browser strikes back
jonoalderson
0
1.1k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Practical Orchestrator
shlominoach
191
11k
HDC tutorial
michielstock
2
670
Transcript
Info and tips for Gradle and Android Studio
Google Plus plus.google.com/+FedeFdez Twitter @FedeProEx Web projectsexception.com
Eclipse / Ant Maven Gradle Android Build System
None
Single Build System Build from command line or your IDE
Default folder structure Tasks for build, test, install,...
Simplify AndroidManifest Version code and version name Package identifier Minimum
and target sdk Placeholder support
Build Types Debug, release and your owns Add application id
and name suffixes Signing Configurations Running proguard
Dependency Management Local packages Build type specific dependency No need
to distribute the dependencies Multi project support
None
1 android { 2 compileSdkVersion 19 3 buildToolsVersion '19.0.0' 4
5 defaultConfig { 6 applicationId 'com.example.app' 7 versionCode 12 8 versionName '2.0' 9 minSdkVersion 16 11 targetSdkVersion 16 12 } 13 } Simplify Manifest
1 android { 2 buildTypes { 3 debug { 4
applicationIdSuffix '.debug' 5 versionNameSuffix '-debug' 6 } 7 release { 8 runProguard true 9 proguardFiles 'file1.pro', 'file2.pro' 10 signingConfig signingConfigs.mySignConfig 11 } 12 } 13 } Build Types
1 android { 2 signingConfigs { 3 mySignConfig { 4
storeFile = file(project.property('file')) 5 storePassword = project.property('password') 6 keyAlias = project.property('keyAlias') 7 keyPassword = project.property('keyPassword') 8 // Command line or environment variable 9 // System.console().readLine("\n\$ Password: ") 10 // System.getenv("KEYSTORE") 11 } 12 } 13 } Signing Config
1 dependencies { 2 // All jar in libs folder
3 compile fileTree(dir: 'libs', include: ['*.jar']) 4 // Dependency from repository 5 compile 'com.android.support:support-v4:20.0.0' 6 // Library project in same folder 7 compile project(':library-project') 8 // Dependency for release build 9 releaseCompile 'com.google.code.gson:gson:2.3' 10 } Dependencies
None
Flavors Application variants Same type as the android.defaultConfig Flavor specific
dependencies Build Type + Product Flavor = Build Variant
Multi-Flavors Distinct dimensions Flavors are assigned to a specific dimension
Combine dimensions to create de app
1 flavorDimensions 'type', 'store' 2 productFlavors { 3 full {
4 flavorDimension 'type' 5 } 6 lite { 7 flavorDimension 'type' 8 } 9 amazon { 10 flavorDimension 'store' 11 } 12 play { 13 flavorDimension 'store' 14 } Flavors fullAmazonDebug fullAmazonRelease liteAmazonDebug liteAmazonRelease fullPlayDebug fullPlayRelease litePlayDebug litePlayRelease
Source Sets Build Types and Product Flavors have their own
sourceSet src/main, src/<buildType1>, src/<flavor1>,... Source code (src/*/java) generate a single output Manifests are all merged Resources using priority: BuildType > Flavor > Main
1 <manifest> 2 <application> 3 <activity> 4 <!-- --> 5
</activity> 6 </application> 7 </manifest> Manifest Merge 1 <manifest> 2 <uses-permission> 3 </manifest> 1 <manifest> 2 <uses-permission> 3 <application> 4 <activity> 5 <!-- --> 6 </activity> 7 </application> 8 </manifest> 1 2 3
Gradle + Android Studio
Android Studio vs Eclipse AS Eclipse Build system Gradle Ant
Maven-based build dependencies Yes No Build variants and multiple-APK generation Yes No Advanced Android code completion and refactoring Yes No Graphical layout editor Yes Yes APK signing and keystore management Yes Yes NDK support Soon Yes
Some Features An IDE built for Android Gradle integration IntelliJ
IDEA is the base for Android Studio Preview resources (drawables, strings,...) Advanced layout editor (includes, xml drawables) Templates
None
None
None
None
None
None
None
Resources tools.android.com/tech-docs/new-build-system/user-guide plus.google.com/+PhilippeBreault github.com/keyboardsurfer/idea-live-templates stackoverflow.com/questions/tagged/gradle+android
None