• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Gradle & Android Studio - Introduction
 

Gradle & Android Studio - Introduction

on

  • 697 views

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.

Statistics

Views

Total Views
697
Views on SlideShare
697
Embed Views
0

Actions

Likes
0
Downloads
14
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Gradle & Android Studio - Introduction Gradle & Android Studio - Introduction Presentation Transcript

    • Gradle & Android Studio An introduction
    • drivr.com @drivr FIRSTDRIVR
    • Schedule ● ● ● ● ● ● Why Gradle? Converting an existing project Build types and product flavors Custom tasks Testing Continuous integration
    • Why Gradle?
    • Pros ● Not Ant ● Groovy-based ● Gradle wrapper ● Multi-project builds ● Dependency management
    • Cons ● Slower than Ant ● Documentation ● Android plugin under development ● Dependency management
    • Demo - New project
    • Convert a project
    • How to convert ● Project structure ● Gradle wrapper ● Dependencies Good resource: http://ryanharter.com/blog/2013/07/17/migrating-android-projects-to-gradle
    • Types & flavors
    • Build types ● E.g. debug, staging, production ● Separate packages ● Different resources
    • Build types - Example buildTypes { staging { packageNameSuffix ".staging" versionNameSuffix "-staging" signingConfig signingConfigs.staging } }
    • Build types - Example signingConfigs { staging { storeFile file("staging.keystore") storePassword "storepwd" keyAlias "alias" keyPassword "keypwd" } }
    • Build types - Example module src staging java res AndroidManifest.xml
    • Product flavors ● E.g. free, pro ● Multi APK (e.g. <= 2.2 & > 2.2) ● Combination Setup: same as build types
    • Build variants Build type + Product flavor = Build variant ● Pro Debug & Free Debug ● Pro Staging & Free Staging ● ...
    • Custom tasks
    • Custom tasks - Example task keyStorePassword << { def keystorePw = new String( System.console().readPassword ("Password?")) android.signingConfigs.release .storePassword = keystorePw }
    • Custom tasks - Example tasks.whenTaskAdded { task -> if (task.name.equals("packageRelease")) { task.dependsOn "keyStorePassword" } }
    • Testing
    • Instrumentation tests ● No separate project ○ srcinstrumentTest ● Own dependencies ○ dependencies { instrumentTestCompile x } ● gradlew connectedInstrumentTest
    • Unit tests (JUnit & Robolectric) ● No official support ● Add custom task ● Some hacking required
    • Continuous integration
    • 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/
    • Want to get started?
    • 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
    • Contact me @kevinpelgrims http://kevinpelgrims.com/blog