Entwicklung mit Android Studio und Gradle

  • View
    610

  • Download
    1

Embed Size (px)

Text of Entwicklung mit Android Studio und Gradle

  1. 1. Entwicklung mit Android Studio und Gradle
  2. 2. ber mich Tim Roes Software Developer bei inovex GmbH www.timroes.de www.timroes.de/+
  3. 3. Android Studio 16. Mai 2013
  4. 4. Android Studio
  5. 5. Android Studio
  6. 6. Android Studio
  7. 7. Android Studio vs. Eclipse Features Stabilitt Performance Weiterentwicklung
  8. 8. Features
  9. 9. Android Studio vs. Eclipse + Features + Stabilitt Performance Weiterentwicklung
  10. 10. Android Studio vs. Eclipse + Features + Stabilitt + Performance Weiterentwicklung
  11. 11. Android Studio vs. Eclipse + Features + Stabilitt + Performance Weiterentwicklung
  12. 12. Weiterentwicklung
  13. 13. Android Studio vs. Eclipse + Features + Stabilitt + Performance + Weiterentwicklung
  14. 14. Apache License Groovy Gradleware IDE == Konsole
  15. 15. Gradle Wrapper $ gradle -q wrapper $ find . --magic-output-format gradlew.bat gradlew gradle wrapper gradle-wrapper.jar gradle-wrapper.properties .gradle 1.11 ...
  16. 16. Gradle Tasks $ ./gradlew tasks init wrapper dependencies help projects properties tasks
  17. 17. build.gradle apply plugin: "java"
  18. 18. build.gradle apply plugin: "java" repositories { mavenCentral() } dependencies { compile 'com.google.guava:guava:17.+' }
  19. 19. build.gradle apply plugin: "java" repositories { mavenCentral() maven { url "http://maven.mycompany.com/" } } dependencies { compile 'com.google.guava:guava:17.+' testCompile 'junit:junit:4.11' compile fileTree(dir: 'libs', include: ['*.jar']) }
  20. 20. Android Plugin buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } apply plugin: "android"
  21. 21. Versions Hlle Android Studio Android Plugin Gradle 0.10 1.12 1.11 1.10 0.9 0.8 1.90.7 0.5.8 0.5.0 0.4.6 0.5.7
  22. 22. Android Tasks $ ./gradlew tasks clean assemble check build installDebug connectedCheck deviceCheck
  23. 23. Android Projekt Struktur project module settings.gradle build.gradle local.properties src build.gradle main androidTest java res assets AndroidManifest.xml
  24. 24. Android Config android { compileSdkVersion 19 buildToolsVersion "19.1" defaultConfig { minSdkVersion 14 targetSdkVersion 19 versionCode 5 versionName "1.3.1" } }
  25. 25. Build Types android { buildTypes { debug { packageNameSuffix ".debug" } proGuard.initWith(buildTypes.debug) proGuard { runProguard true proguardFile 'proguard-rules.txt' } } }
  26. 26. Multi-APK/Version Library Paid-App Demo
  27. 27. Projektstruktur src main java res paid java res free java res AndroidManifest.xml
  28. 28. Product Flavors productFlavors { paid { packageName "com.mycompany.app.paid" } free { packageName "com.mycompany.app.free" minSdkVersion 8 } }
  29. 29. Build Variant Build Variant = Product Flavor + BuildType paidDebug freeDebug paidRelease freeRelease paidProGuard freeProGuard
  30. 30. Kann ich Android Studio schon produktiv einsetzen? Ja, aber...
  31. 31. Literaturempfehlung Gradle: Ein kompakter Einstieg in das Build- Management-System Joachim Baumann Prorgramming Groovy 2: Dynamic Productivity for the Java Developer Venkat Subramaniam
  32. 32. www.timroes.de www.inovex.de Disclaimer: Logos are copyrighted trademarks by their respective companies. Android Robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.
  33. 33. NDK Builds android { defaultConfig { ndk { moduleName "jni-utils" ldLibs "log", "GLESv2" } } productFlavors { arm { ndk { abiFilters "armeabi", "armeabi-v7a" } } } }
  34. 34. Multi-flavor variants android { flavorGroups "abi", "version" productFlavors { free { flavorGroup "version" } paid { flavorGroup "version" } x86 { flavorGroup "abi" } arm { flavorGroup "abi" } } }