Understanding Android Build Variants

28
UNDER ST ANDING ANDROID BUILD V ARIANT S

Transcript of Understanding Android Build Variants

UNDERSTANDINGANDROIDBUILD

VARIANTS

Donn Felker@donnfelker

4 Time Android Book AuthorCo-Host of Fragmented

Podcastdonnfelker.com | caster.io

BUILD VARIANTSALL UP IN YOUR GRILL

Create Flexible Runtime

EnvironmentsLIKE WHOA

No, for real, what are they?

Build variants allow you to quickly create different versions of your app from the same

source code. Kinda.

Build variants facilitate

composability within the Android build

system.

Yo, wheres theCODE?!?!

here: github.com/casterio

simple exampleCreating a debug package

branch: debug-suffix

Crazy, I know.

Ok, it's not really that impressive.

app-debug.apkmore like lame-debug.apk

lets fix thatbranch: change-app-name

WickedCool-debug.apk

Much better.

Moving on ...

Mmm Product Flavors

Free and Pro Versions

Why do I need free and pro versions?

Some people like to watch their money

Nah, I'm kidding.

Its about exposure and conversions

We all love free stuff.

If you like it, first ones on the house.

AKA: Trials (aka: drug dealer model)

Free and Paid Versions

branch: product-flavors

I know, right?

Ok, maybe just a little

Android Manifest Values

Update the manifest at build time with the manifest merger

branch: manifest-placeholders

Release / Debug Composability

Say what?Debug only logging/etcRelease only Crashlytics Logging

Custom Resources!

Different layouts, icons, etc at runtime

branch: custom-resources

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

direction.

@donnfelker

thanks