I have an Android application that is by default built with Ant.
There is build.xml
file which loads local.proerties
file. I would like to add my custom property (for example Google Maps apiKey) and access it in Java classes - for example in some MainActivity.
How can I achieve it ?
Ant provides a target called "sysproperty". Its like a property tag, but it sets the java System.property. So, you can do something like:
<sysproperty name="foo" value="$THE_EXTRA_PROPERTY">
where "THE_EXTRA_PROPERTY" is the extra property that you added to the properties file that gets loaded.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.