私のチタン アプリケーションでは、再利用したいいくつかの Android アクティビティで構成される Android jar を含むカスタム ネイティブ Android モジュールを作成しています。アプリケーションからこれらのアクティビティを呼び出すにはどうすればよいですか。
1 に答える
2
これは、Titanium Android モジュール開発ガイドhttps://wiki.appcelerator.org/display/guides/Android+Module+Development+Guideから直接引用したものです。
モジュールを Titanium Mobile アプリで使用するには、次の手順に従います。
モジュール zip を Titanium アプリのルート、またはシステムの Titanium インストールのルートにコピーします。アプリケーションの 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>
require 関数を使用して、アプリのコードでモジュールを読み込みます。例:
var Module = require('$MODULE_ID'); // For example, to load the calc module: var Calc = require('org.appcelerator.calc');
次にアプリを起動またはビルドするときに、モジュールをアプリケーションに含める必要があります
于 2013-04-15T01:26:20.853 に答える