Tuesday, March 27, 2012

Setting Keys Based on Build Type

One thing I've been doing for a while is using a different key for Google Analytics based on whether I'm developing the application or deploying it to the market.  The concept is simple enough, but it does result in a manual step of swapping the keys at deploy time.

The latest release of the ADT includes a new constant that gets set for you depending on the type of build!  Now you can query BuildConfig.DEBUG to determine if your build is for development (DEBUG = true) or deployment (DEBUG = false).

I'm using it successfully as follows:

UACODE = (BuildConfig.DEBUG) ? "UA-12345678-1" : "UA-12345678-2"; // Test : Production


Monday, March 12, 2012

Note to self ...

I just thought I'd take a minute to share something I've been doing recently.  There's always data you want to quickly capture for later or maybe you just want to get something from your mom's PC to yours.

Compose a gmail message with a subject and no recipient!  It gets saved as a draft and you have access to the mesage from any device that can get to gmail!

You're welcome :)