This is a sample showing how to change dinamically the locate and retrieve this from Device Preferences