Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cradle to the Gradle

Reed Allman
November 05, 2013

Cradle to the Gradle

Building Android without the migraine, using Android Studio, Gradle and Genymotion.

Reed Allman

November 05, 2013

More Decks by Reed Allman

Other Decks in Technology


  1. Cradle to the Gradle Building Android Without the Migraine @rdallman10

  2. Hello darkness, my old friend

  3. R cannot be resolved to a type...

  4. Dependencies missing...

  5. Fix project properties…

  6. Egit says you have unresolved conflicts...

  7. PC load letter… What the $#@! does that mean?

  8. Eclipse, meet your maker

  9. A UI for this millenium

  10. Version control baked in. And it works!

  11. Doesn’t randomly freeze. And it’s in beta!

  12. Will still suck all your RAM. But it tells you

    how much!
  13. All the “great IDE features.” And it’s not Eclipse!

  14. OK, real talk on some features

  15. Preview all screen sizes

  16. Jump from Activity to its Layout

  17. Jump from Layout to its Activity

  18. Jump from Fragment to its Layout

  19. Jump from Layout to its Fragment

  20. It’s &%$*ing life changing

  21. Some Useful commands: Jump to File: ⌘⇧O Jump to Class:

    ⌘O Run: ^⌘R Find All (Project): ⌘⇧F ...Hover and it’ll tell you
  22. http://developer.android.com/sdk/installing/studio.html

  23. Now to the real cool stuff

  24. Let’s talk dependency management

  25. Maybe you did this? (guilty)

  26. Maybe you did this? (guilty again)

  27. And what do we say?

  28. No more carrying around dependencies! All we need is a

    build.gradle file
  29. The dayman cometh

  30. So let’s talk build.gradle

  31. AndroidManifest.xml gets stupid-er

  32. Versioning / SDK moves to build.gradle

  33. How many bloody DSL’s are there?

  34. It’s just Groovy, baby.

  35. ...So enough of that.

  36. Why should I make the switch?

  37. None
  38. Ever seen this?

  39. https://gist.github.com/rdallman/7314868

  40. Build [release] from command line

  41. Take that, Eclipse

  42. For you heavy readers: http://tools.android.com/tech-docs/new-build-system/user-guide

  43. Also makes collaborating easy.

  44. Clone (or otherwise acquire) project source:

  45. Just import build.gradle file

  46. Also automagically sets up VCS and remotes

  47. One last thing…

  48. Poll: how long does this normally take you?

  49. Maybe you’re sick of always carrying one of these around

  50. Walk towards the light... http://www.genymotion.com/

  51. Integrates right into Android Studio (plugin)

  52. Make the switch. For Android. For Sanity. Let me know

    if you need any help! [email protected]
  53. Android Studio: http://developer.android.com/sdk/installing/studio.html Android Gradle: http://tools.android.com/tech-docs/new-build-system/user-guide Versioning build.gradle: https://gist.github.com/rdallman/7314868 Find

    maven dependencies: http://gradleplease.appspot.com/ Genymotion: http://www.genymotion.com/ Link Summary (+goodies):