简体   繁体   English

IBM Worklight - 如何使Android环境代码与生成的项目“独立”?

[英]IBM Worklight - How to make Android environment code “independent” from the generated project?

When I build a Worklight project that also has the Android environment, a separate Android project is generated. 当我构建一个也具有Android环境的Worklight项目时,会生成一个单独的Android项目。 That's fine. 没关系。

If I add any files to the native folder of the Android environment which is residing in the Worklight project, those changes are getting replicated in the generated Android project. 如果我将任何文件添加到驻留在Worklight项目中的Android环境的本机文件夹中,那么这些更改将在生成的Android项目中进行复制。 But, if I delete the generated project completely (for whatever reason), all the modifications that I've done in Worklight Android environment are lost (native folder is getting deleted). 但是,如果我完全删除生成的项目(无论出于何种原因),我在Worklight Android环境中完成的所有修改都将丢失(本机文件夹将被删除)。

Should that happen like that? 这会发生吗? Or is there any other approach have I to follow? 或者我还有其他方法吗?

When deleting the generated Android project make sure that you choose to not delete the project resources from disk. 删除生成的 Android项目时,请确保选择从磁盘中删除项目资源。

Note that changes done in the native folder should be of specific nature, that is: 请注意,在本机文件夹中执行的更改应具有特定性质,即:

  • change native resources (icons, images, ... for this we have the nativeResources folder) 更改本机资源(图标,图像,...为此我们有nativeResources文件夹)
  • native code 本机代码

Any other modifications should most probably be done in the common or android folders rather than the android\\native folder. 任何其他修改应该最好在common或android文件夹而不是android \\ native文件夹中完成。

Delete androidtestTestappAndroid 删除androidtestTestappAndroid
在此输入图像描述


Make sure the checkbox is not ticked 确保选中该checkbox
在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM