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
Tweet

More Decks by Reed Allman

Other Decks in Technology

Transcript

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

    View Slide

  2. Hello darkness, my old
    friend

    View Slide

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

    View Slide

  4. Dependencies missing...

    View Slide

  5. Fix project properties…

    View Slide

  6. Egit says you have unresolved conflicts...

    View Slide

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

    View Slide

  8. Eclipse, meet your maker

    View Slide

  9. A UI for this millenium

    View Slide

  10. Version control baked in.
    And it works!

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  14. OK, real talk on some features

    View Slide

  15. Preview all screen sizes

    View Slide

  16. Jump from Activity to its Layout

    View Slide

  17. Jump from Layout to its Activity

    View Slide

  18. Jump from Fragment to its Layout

    View Slide

  19. Jump from Layout to its Fragment

    View Slide

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

    View Slide

  21. Some Useful commands:
    Jump to File: ⌘⇧O
    Jump to Class: ⌘O
    Run: ^⌘R
    Find All (Project): ⌘⇧F
    ...Hover and it’ll tell you

    View Slide

  22. http://developer.android.com/sdk/installing/studio.html

    View Slide

  23. Now to the real cool stuff

    View Slide

  24. Let’s talk dependency management

    View Slide

  25. Maybe you did this?
    (guilty)

    View Slide

  26. Maybe you did this?
    (guilty again)

    View Slide

  27. And what do we say?

    View Slide

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

    View Slide

  29. The dayman cometh

    View Slide

  30. So let’s talk build.gradle

    View Slide

  31. AndroidManifest.xml gets stupid-er

    View Slide

  32. Versioning / SDK moves to build.gradle

    View Slide

  33. How many bloody DSL’s are there?

    View Slide

  34. It’s just Groovy, baby.

    View Slide

  35. ...So enough of that.

    View Slide

  36. Why should I make the switch?

    View Slide

  37. View Slide

  38. Ever seen this?

    View Slide

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

    View Slide

  40. Build [release] from command line

    View Slide

  41. Take that, Eclipse

    View Slide

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

    View Slide

  43. Also makes collaborating easy.

    View Slide

  44. Clone (or otherwise acquire) project source:

    View Slide

  45. Just import build.gradle file

    View Slide

  46. Also automagically sets up VCS and remotes

    View Slide

  47. One last thing…

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  51. Integrates right into Android Studio (plugin)

    View Slide

  52. Make the switch. For Android. For Sanity.
    Let me know if you need any help!
    [email protected]

    View Slide

  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):

    View Slide