I want to have my app switch between development and production web services without changing too much in the code (and be relatively fool proof).
Right now I have my web service addresses as
static final String
static final boolean
I promised I'd do it and here it is:
Also mirrored on GitHub: https://github.com/blundell/BuildChoiceTut
With the tutorial you can switch configurations using Ant build scripts.
You setup a directory called /config/ in here you hold all your constants for different configurations. Once for each file i.e. live.props dev.props beta.props
Then when Ant runs it will read the selected file and 'inject' them into your build just before it is compiled.