title: PhoneGap 1.0.0 - Android 2.1/2.3 - Not able to make a phonegap plugin to work asynchronously
body: <p>What I'm trying to do:</p>
  
  <ol>
  <li>user fills out a form data, clicks submit.</li>
  <li>user presented with a loading screen. (HTML element).</li>
  <li>Application makes asynchronous call, PhoneGap plugin, which saves this data in db. That's where the problem is, because the call is synchronous instead.</li>
  <li>When html app receives a callback, I hide loading screen.</li>
  </ol>
  
  <p>Because of synchronous call that's what I got:</p>
  
  <ol>
  <li>user fills out a form, submits</li>
  <li>HTML app freezes, data is being saved to a database.</li>
  <li>loading screen appears</li>
  <li>callback is called, a few milliseconds after.</li>
  </ol>
  
  <p>Here's some demo (trimmed) code:</p>
  
  <p>Java:</p>
  
  <pre><code>public class SomePlugin extends Plugin
  ...
  public PluginResult execute(String action, JSONArray data, String callbackId) 
  {
      PluginResult result = null;
      //
      // save data in the background...
      //
      Log.d("TAG", "Some Message...");
  
      result = new PluginResult(Status.OK, "");
      // or 
      // result = new PluginResult(Status.ERROR);
  
      return result;
  }
  ...
  public boolean isSynch(String action) {
       return false; // always do async...
  }
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>$('#loading-screen').show();
  
  var successCallback = function() {
      console.log('Success Callback');
      $('#loading-screen').hide();
  };
  var failureCallback = function() {
      console.log('Failed Callback');
      $('#loading-screen').hide();
  };
  
  PhoneGap.exec(successCallback, failureCallback, 'PluginName', 'actionName', data);
  </code></pre>
  
  <p>From PhoneGap source:</p>
  
  <pre><code>* Execute a PhoneGap command.  It is up to the native side whether this action is synch or async.
  * The native side can return:
  *      Synchronous: PluginResult object as a JSON string
  *      Asynchrounous: Empty string ""
  * If async, the native side will PhoneGap.callbackSuccess or PhoneGap.callbackError,
  * depending upon the result of the action.
  </code></pre>
  
  <p>So I thought maybe this line is incorrect in that case:</p>
  
  <pre><code>new PluginResult(Status.OK, "");
  </code></pre>
  
  <p>Note: If wrap (JavaScript) PhoneGap.exec call in setTimeout (with a delay of 1 sec for example), loading screen will work "properly" (it's still frozen but user have an instant feedback), but that's obviously not a solution.</p>
  
  <p>I think I just not seeing something obvious here, just one parameter or something somewhere. </p>
  
  <p>Thanks.</p>