$30 off During Our Annual Pro Sale. View Details »

Understanding Build Variants

Donn Felker
February 26, 2015

Understanding Build Variants

. Learn how to develop, free and pro versions of your applications. How to perform debug only configurations and how to use Build Variants in your day to day Android Development.

Donn Felker

February 26, 2015
Tweet

More Decks by Donn Felker

Other Decks in Programming

Transcript

  1. UNDERSTANDING
    ANDROID
    BUILD
    VARIANTS

    View Slide

  2. Donn Felker
    @donnfelker
    4 Time Android Book Author
    Co-Host of Fragmented
    Podcast
    donnfelker.com | caster.io

    View Slide

  3. BUILD VARIANTS
    ALL UP IN YOUR GRILL

    View Slide

  4. Create Flexible
    Runtime
    Environments
    LIKE WHOA

    View Slide

  5. No, for real, what are they?
    Build variants allow you to quickly create
    different versions of your app from the same
    source code. Kinda.

    View Slide

  6. Build variants
    facilitate
    composability within
    the Android build
    system.

    View Slide

  7. Yo, wheres the
    CODE?!?!
    here: github.com/casterio

    View Slide

  8. simple example
    Creating a debug package
    branch: debug-suffix

    View Slide

  9. Crazy, I know.
    Ok, it's not really that impressive.

    View Slide

  10. app-debug.apk
    more like lame-debug.apk
    lets fix that
    branch: change-app-name

    View Slide

  11. WickedCool-debug.apk
    Much better.
    Moving on ...

    View Slide

  12. Mmm Product Flavors
    Free and Pro Versions

    View Slide

  13. Why do I need free
    and pro versions?

    View Slide

  14. Some people like to watch their money

    View Slide

  15. Nah, I'm kidding.
    Its about exposure
    and conversions

    View Slide

  16. View Slide

  17. We all love free stuff.
    If you like it, first
    ones on the house.
    AKA: Trials (aka: drug dealer model)

    View Slide

  18. Free and Paid
    Versions
    branch: product-flavors

    View Slide

  19. I know, right?
    Ok, maybe just a little

    View Slide

  20. Android Manifest
    Values
    Update the manifest at build
    time with the manifest merger
    branch: manifest-placeholders

    View Slide

  21. View Slide

  22. Release / Debug
    Composability

    View Slide

  23. Say what?
    Debug only logging/etc
    Release only Crashlytics Logging

    View Slide

  24. View Slide

  25. Custom Resources!
    Different layouts,
    icons, etc at runtime
    branch: custom-resources

    View Slide

  26. View Slide

  27. There is a lot more,
    but that should get
    you going in the right
    direction.

    View Slide

  28. @donnfelker
    thanks

    View Slide