Your SlideShare is downloading. ×
  • Like
Gradle & Android Studio - Introduction
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Gradle & Android Studio - Introduction

  • 1,452 views
Published

This is a very high level overview of Gradle. Android Studio tips and tricks were shown during demos, so the slides themselves don't really contain any info on Android Studio.

This is a very high level overview of Gradle. Android Studio tips and tricks were shown during demos, so the slides themselves don't really contain any info on Android Studio.

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,452
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
23
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Gradle & Android Studio An introduction
  • 2. drivr.com @drivr FIRSTDRIVR
  • 3. Schedule ● ● ● ● ● ● Why Gradle? Converting an existing project Build types and product flavors Custom tasks Testing Continuous integration
  • 4. Why Gradle?
  • 5. Pros ● Not Ant ● Groovy-based ● Gradle wrapper ● Multi-project builds ● Dependency management
  • 6. Cons ● Slower than Ant ● Documentation ● Android plugin under development ● Dependency management
  • 7. Demo - New project
  • 8. Convert a project
  • 9. How to convert ● Project structure ● Gradle wrapper ● Dependencies Good resource: http://ryanharter.com/blog/2013/07/17/migrating-android-projects-to-gradle
  • 10. Types & flavors
  • 11. Build types ● E.g. debug, staging, production ● Separate packages ● Different resources
  • 12. Build types - Example buildTypes { staging { packageNameSuffix ".staging" versionNameSuffix "-staging" signingConfig signingConfigs.staging } }
  • 13. Build types - Example signingConfigs { staging { storeFile file("staging.keystore") storePassword "storepwd" keyAlias "alias" keyPassword "keypwd" } }
  • 14. Build types - Example module src staging java res AndroidManifest.xml
  • 15. Product flavors ● E.g. free, pro ● Multi APK (e.g. <= 2.2 & > 2.2) ● Combination Setup: same as build types
  • 16. Build variants Build type + Product flavor = Build variant ● Pro Debug & Free Debug ● Pro Staging & Free Staging ● ...
  • 17. Custom tasks
  • 18. Custom tasks - Example task keyStorePassword << { def keystorePw = new String( System.console().readPassword ("Password?")) android.signingConfigs.release .storePassword = keystorePw }
  • 19. Custom tasks - Example tasks.whenTaskAdded { task -> if (task.name.equals("packageRelease")) { task.dependsOn "keyStorePassword" } }
  • 20. Testing
  • 21. Instrumentation tests ● No separate project ○ srcinstrumentTest ● Own dependencies ○ dependencies { instrumentTestCompile x } ● gradlew connectedInstrumentTest
  • 22. Unit tests (JUnit & Robolectric) ● No official support ● Add custom task ● Some hacking required
  • 23. Continuous integration
  • 24. CI with Jenkins ● Android SDK on build server ● Gradle plugin - “Invoke Gradle script” ● Emulator support Good resource: http://blog.zuehlke.com/configure-your-android-project-on-jenkins/
  • 25. Want to get started?
  • 26. Resources http://tools.android.com/tech-docs/new-build-system/user-guide http://www.gradle.org/documentation https://plus.google.com/+AndroidDevelopers/posts https://gradleplease.appspot.com DuckDuckGo / Google
  • 27. Contact me @kevinpelgrims http://kevinpelgrims.com/blog