Modified to work on both Eclipse and Android Studio
Added support for Gradle (Android Studio)