4

Would like to ask, is it possible for me to integrate both Intel XDK API and Phonegap API in a single mobile app? This is because, some of the API is only available in Phonegap and vice versa.

WenHao
  • 1,183
  • 1
  • 15
  • 46

2 Answers2

6

Yes, if I understand the question correctly, I believe you can access both API's in a single app using Intel XDK.

OldGeeksGuide
  • 2,888
  • 13
  • 23
2

These hints can be found in index.html when you build a new blank project on XDK:

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.)

so the answer is yes you can use both , also you may notice that some APIs like Accelerometer , Geolocation , or Base API have been deprecated , and it is recommended by intel to use Cordova API instead to use these features.

xdk cordova

Note:

You will not find source files for intelxdk.js or cordova.js , as you can see they are Phantom files , automaticaly inserted in your script , so you shouldnt add any aditional source for both scripts , should you want to remove any of both sources , just delete the corresponding lines found in 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 -->
ProllyGeek
  • 15,517
  • 9
  • 53
  • 72