Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a string resource to strings.xml in a cordova project

Tags:

gradle

cordova

When issuing cordova build android, a build.gradle file is auto generated.
I'd like this script to insert a variable to the strings.xml file. I can do this by adding a resValue line to build.gradle but I don't want to change that auto-generated file.
Anyway to achieve that?

like image 444
Tal Avatar asked Dec 02 '15 22:12

Tal


1 Answers

You can add the string in plugin.xml.

    <config-file target="res/values/strings.xml" parent="/*">
        <string name="pick_any_option">Pick any option...</string>
    </config-file> 
like image 175
Luis Miguel Martín Avatar answered Oct 29 '22 10:10

Luis Miguel Martín