Tries to fix Travis configuration.

This should be a more reliable way to fetch the parts of the Android SDK
we need. It also creates a script, which is easier to test than the
.travis.yml file.