For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
Original solution sacrifices new api lint check.
Here my solution:
int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16
apply plugin: 'com.android.application'
android {
compileSdkVersion 23