Is there a way to pass ant variables to java code (android)?

前端 未结 3 1233
滥情空心
滥情空心 2021-01-25 05:59

I like to include some build variables in my application. For example a buildnumber. Can I pass some variables from a ant build script to my Android application and use that var

3条回答
  •  情话喂你
    2021-01-25 06:17

    Just populate the build number into a string xml file and read it as normal. You can use the replace task to do that..

    Dont use a properties file since there is not Android native way to read it. The native way are string values in the xml files. And it is better to replace it into a static strings xml file rather than java source code too.

提交回复
热议问题