In XDK, we are forced to choose between creating a HTML5+Cordova project and Standard HTML5 project.
I have not been able to find a discussion on the differences between them.
Some people believes that a Standard HTML5 project means that it will be hosted on remote web server like a Single Page App (SPA). LIke a bunch of static HTML, JS, CSS files for web server.
My personal guess is they differ in the output format after a build? For Cordova projects, they can be built into Android .apk and iOS .ipa format? While Standard HTML5 project would build into a ZIP archive for uploading to web server?
More specifically, what will a developer lose out when he chooses the Standard HTML5 project, without Cordova. Certainly Cordova plugins will not be available but HTML5 capabilities in geo-location, WebSocket, WebRTC, camera, video, audio, and storage handling can handle many of the basic tasks. Perhaps without accelerometer.
The main difference could be in the API. For example to take a photo:
Cordova
navigator.camera.getPicture(onSuccess, onFail, {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL
});
HTML5
navigator.webkitGetUserMedia('video, audio', onSuccess, onError);
function onSuccess(stream) {
var output = document.getElementById('output'); //a element
output.autoplay = true; //you can set this in your markup as well
output.src = is_webkit ? window.webkitURL.createObjectURL(stream) : stream;
}
function takepicture(videoOutput, width, height) {
var canvas = document.getElementById('canvas'),
photo = document.querySelector('photo');
canvas.width = width;
canvas.height = height;
canvas.getContext('2d').drawImage(videoOutput, 0, 0, width, height);
var data = canvas.toDataURL('image/png');
photo.setAttribute('src', data);
}
Hope experienced XDK users and Intel can address this.