问题
I’am currently write an application and i need to put a content directly in the resource file (theme.res). How can I achieve this? What about the binary format of the resource file?
Is it possible to achieve the same thing with the use of CodenameOne designer tool in command line? I want to put a localization bundle in the RES file with my custom app. Thanks!
回答1:
You can check the XML Team Mode
flag in the designer tool and save. Once you do that you will see an XML file and a hierarchy next to it in the res
directory. This will be used by the designer tool but is invisible to the build process.
You can use the following in the latest designer tool:
java -jar /path/to/designer_1.jar -sync-xml /path/to/theme.res
This updates the res file from the XML.
Alternatively you can add this to the build.xml
so it's automated:
<taskdef name="syncXML" classname="com.codename1.build.client.SyncXMLTask" classpath="CodeNameOneBuildClient.jar"/>
Then use this in some place to regenerate the res file:
<syncXML/>
来源:https://stackoverflow.com/questions/50010241/insert-data-in-codename-one-resource-file-in-command-line-or-directly