Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

codenameone

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!

like image 706
Eric Avatar asked Nov 30 '25 13:11

Eric


1 Answers

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/>
like image 162
Shai Almog Avatar answered Dec 02 '25 04:12

Shai Almog



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!