title: Check when multiple files have dowloaded with PhoneGap
body: <p>I've been using PhoneGap 2.9.0 (with build) to download files from a website to store on my sdcard on my android device.</p>
  
  <p>I am looking for a solution to download multiple files and check that all of these requests have been completed successfull.</p>
  
  <p>I have been told this is possible with using <strong><a href="http://api.jquery.com/jQuery.Deferred/" rel="nofollow">jQuery.Deffered</a></strong> but I have yet to use this in any code and I am struggling to get my head round it.</p>
  
  <p>Existing Code works fine in theory but only checks when the last download in my array has downloaded succesfully but sometimes the last download sometimes returns succesfully before others.</p>
  
  <p><strong>My code is similar to below:</strong></p>
  
  <pre><code>var ft = new FileTransfer();
  var online = [
      'http://google.com/img/1.jpg', 
      'http://google.com/img/2.jpg',
      'http://google.com/img/3.jpg'
  ];
  var sdcard = 'file:///storage/sdcard0/';
  
  $.each( online, function(k,v) { 
      ft.download(
          online[k],
          sdcard,
          win,
          fail
      );
  }
  
  var win = function(success, counter){
     // check if counter is last element in array
  
         // redirect user to page if last element
  }
  
  var fail = function(error){
    console.log(error);
  }
  </code></pre>