在命令行或直接在一个资源文件的代号中插入数据 [英] Insert data in codename one resource file in command line or directly

查看:54
本文介绍了在命令行或直接在一个资源文件的代号中插入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在编写一个应用程序,我需要将内容直接放在资源文件(theme.res)中。我该如何实现?资源文件的二进制格式呢?

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?

在命令行中使用CodenameOne设计器工具是否可以实现相同的目的?我想使用我的自定义应用程序将本地化包放入RES文件中。谢谢!

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!

推荐答案

您可以在 XML Team Mode 标志中进行检查。设计工具并保存。完成后,您将在 res 目录中看到一个XML文件及其旁边的层次结构。这将由设计器工具使用,但在构建过程中不可见。

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

这将从XML更新res文件。

This updates the res file from the XML.

或者,您可以将其添加到 build.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"/>

然后在某个地方使用它来重新生成res文件:

Then use this in some place to regenerate the res file:

<syncXML/>

这篇关于在命令行或直接在一个资源文件的代号中插入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆