Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to put a string in gradle file and acce to it android studio

// its very useful to put your secret string, api in gradle file to protect it
// by using below code you can put your string Android gradle
// then access to that string by usual way:(Ex) R.string.app_name or @string/app_name
android {
    buildTypes {
        debug{
            resValue "string", "app_name", "My App Name Debug"
        }
        release {
            resValue "string", "app_name", "My App Name"
        }
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #put #string #gradle #file #acce #android #studio
ADD COMMENT
Topic
Name
4+9 =