title: How to make Cordova synchronous
body: <p>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:</p>
  
  <pre><code>var finishedFl = 0;
  cordova.exec(
  function(info) {
      .... [Function goes here]
      finishedFl = 1;
  }, 
  function (info) {
      alert('Error');
  },
  'Smapps', 'getInfo', []);
  
  While(finishedFl != 1){
      wait;
  }
  
  anotherFunction();
  </code></pre>
  
  <p>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?</p>