0 votes
78 views
in android by (0 points)
closed by
You would like to enable analytics tracking only in release builds. How can you create a new field in the generated BuildConfig class to store that value?

 A

buildTypes {
    debug {
        buildConfig 'boolean', 'ENABLE_ANALYTICS', 'false'
    }
    release {
        buildConfig 'boolean', 'ENABLE_ANALYTICS', 'true'
    }
}

 B

buildTypes {
    debug {
        buildConfig 'String', 'ENABLE_ANALYTICS', 'false'
    }
    release {
        buildConfig 'String', 'ENABLE_ANALYTICS', 'true'
    }
}

 C

buildTypes {
    debug {
        buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'false'
    }
    release {
        buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'true'
    }
}

 D

buildTypes {
    debug {
        buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'true'
    }
    release {
        buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'false'
    }
}
closed

1 Answer

0 votes
by (0 points)
 
Best answer
c

2.8k questions

2.8k answers

0 comments

76 users

Welcome to MCQ Village Q&A, where you can ask questions and receive answers from other members of the community.
...