Insert data in codename one resource file in command line or directly

…衆ロ難τιáo~ 提交于 2019-12-21 20:10:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!