Updated for Gradle and Android Studio.