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

Hello I have the following problem:

图片[1]-How I can access the settings I provided via build config in my code? - 拾光赋-拾光赋
How I can access the settings I provided via build config in my code?
Feb 16 ’22
Comments: 4
Answers: 0
0

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"]


Open Full Question

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

原文链接:How I can access the settings I provided via build config in my code?

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容