Skip to content

Instantly share code, notes, and snippets.

@babedev
Last active December 23, 2017 14:47
Show Gist options
  • Save babedev/ae73fc2d034e1eed6ddd63d37cc0f764 to your computer and use it in GitHub Desktop.
Save babedev/ae73fc2d034e1eed6ddd63d37cc0f764 to your computer and use it in GitHub Desktop.
Use getIPAddress()
buildTypes {
local {
buildConfigField("String", "API_URL", "\"http://${getIPAddress()}:5000/api/v1\"")
}
debug {
buildConfigField("String", "API_URL", "\"http://my.staging.server/api/v1\"")
}
release {
buildConfigField("String", "API_URL", "\"http://my.prod.server/api/v1\"")
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment