英特尔XDK + Phonegap

时间:2014-05-02 04:16:39

标签: cordova intel-xdk

想问一下,我是否可以在一个移动应用中集成英特尔XDK API和Phonegap API? 这是因为,某些API仅在Phonegap中可用,反之亦然。

2 个答案:

答案 0 :(得分:6)

是的,如果我正确理解了这个问题,我相信你可以使用英特尔XDK在一个应用程序中访问这两个API。

答案 1 :(得分:2)

当您在XDK上构建新的空白项目时,可以在index.html中找到这些提示:

  

注意:不要在intelxdk.js或cordova.js中使用目录前缀 -   它们会自动插入       通过构建系统,模拟器和其他工具,假设它们位于index.html源目录中。       你不会在项目的任何地方找到这些JS文件,它们是"幻像"库。如果你确实看到了       作为项目的一部分,这些文件的副本应该被移除,以避免混淆XDK。

When building with any of the XDK Cordova build systems (e.g., "Cordova Hybrid App") you can
omit the "intelxdk.js" and "xhr.js" script files shown below. It does not hurt to keep them, but
they are not used in that environment, they are only needed for the "legacy" XDK build systems.
(In the case of the Cordova build system, the Cordova and XDK apis are included as plugins
and the CORS configuration is specified as a parameter in the build configuration file.)

所以答案是肯定的,你可以同时使用这两个,你也可能会注意到某些API,例如AccelerometerGeolocationBase API已被弃用,而且推荐使用使用Cordova API代替使用这些功能。

xdk cordova

注意:

您找不到intelxdk.jscordova.js的源文件,因为您可以看到它们是Phantom个文件,自动插入到您的脚本中,因此您不应为这两个文件添加任何附加源文件脚本,如果要删除任何两个源,只需删除index.html中的相应行:

<script src="intelxdk.js"></script>         <!-- phantom library, needed for XDK api calls -->
<script src="cordova.js"></script>          <!-- phantom library, needed for Cordova api calls -->