My problem is quite simple but I can't find anything online. I am finishing development of a phone app, and I am having some issues with Cordova because of the not-synchronous execution. As it is right now, I have to do something like this:
var finishedFl = 0;
cordova.exec(
function(info) {
.... [Function goes here]
finishedFl = 1;
},
function (info) {
alert('Error');
},
'Smapps', 'getInfo', []);
While(finishedFl != 1){
wait;
}
anotherFunction();
I find this way of programming extremely troubling and obviously not that good. So the question is: Is there any way of making Cordova execution synchronous?