Picking up AndroidStudio changes and upgrading to v1 API

Reviewed in https://codereview.appspot.com/40580043/