2013-03-06 26 views
1

对于我的Titanium应用程序,我正在编写一个自定义的原生android模块,其中包含一个由我想要重用的少量android活动组成的android jar。如何从我的应用程序调用这些活动。在Titanium中调用本机android活动

回答

2

这从来自直钛Android的模块开发指南https://wiki.appcelerator.org/display/guides/Android+Module+Development+Guide

要使用模块中的钛移动应用程序,请按照下列步骤操作:

复制模块压缩到钛的应用程序的根目录,或向 根系统安装钛在应用程序的tiapp.xml,添加 以下XML内:

<!-- $MODULE_VERSION should be the same as "version" in the module manifest --> 
<modules> 
    <module version="$MODULE_VERSION">$MODULE_ID</module> 
    <!-- For example, if we were adding the calc module: --> 
    <module version="0.1">org.appcelerator.calc</module> 
</modules> 

使用需要的功能加载在应用程序的代码模块, 例:下一次应用程序启动或建成

var Module = require('$MODULE_ID'); 
// For example, to load the calc module: 
var Calc = require('org.appcelerator.calc'); 

,模块应 包括在申请