想请问一下,能否在一个移动应用程序中集成Intel XDK API和Phonegap API?因为有些API仅在Phonegap中提供,反之亦然。
当您在XDK上构建新的空白项目时,这些提示可以在index.html中找到:
所以答案是肯定的,您可以同时使用两者,另外您可能会注意到一些API已被弃用,例如NOTE: do not use a directory prefix with intelxdk.js or cordova.js - they are inserted automatically by the build system, emulator and other tools and are assumed to be in the index.html source directory. You will not find these JS files anywhere in your project, they are "phantom" libraries. If you do see copies of these files as part of your project they should be removed to avoid confusing the 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.)
Accelerometer
、Geolocation
或Base
API。Intel建议使用Cordova API来代替这些功能。intelxdk.js
或cordova.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 -->
<script src="cordova.js"></script>
。 - krisrak