4

How I can access the settings I provided via build config in my code?

 2 years ago
source link: https://dev.to/pcmagas/how-i-can-access-the-settings-i-provided-via-build-config-in-my-code-18jb
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How I can access the settings I provided via build config in my code?

Hello I have the following problem:

As seen in oficial android documentation I can use build variants and build my application via different settings.

Therefore, I made my own variants:

android {
    defaultConfig {
        manifestPlaceholders = [hostName:"www.example.com"]
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            applicationIdSuffix ".debug"
            manifestPlaceholders = [hostName:"local.example.com"]

What I want is to access the settings from build.gradle. Do you know how I can do this?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK