title: Plugin doesn't work in Phonegap
body: <p>I am using Cordova 2.1.0 to develop an Android plugin.</p>
  
  <h2>The plugin code is as follows</h2>
  
  <pre><code>package org.apache.cordova.example;
  import org.apache.cordova.api.Plugin;
  import org.apache.cordova.api.PluginResult;
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  public class MyTestPlugin extends Plugin {
    /**
    * Executes the request and returns PluginResult.
    *
    * @param action        The action to execute.
    * @param args          JSONArry of arguments for the plugin.
    * @param callbackId    The callback id used when calling back into JavaScript.
    * @return              A PluginResult object with a status and message.
    */
    public PluginResult execute(String action, JSONArray args, String callbackId) {
      try {
        if (action.equals("echo")) {
          String echo = args.getString(0);
          if (echo != null &amp;&amp; echo.length() &gt; 0) {
            return new PluginResult(PluginResult.Status.OK, echo);
          } else {
            return new PluginResult(PluginResult.Status.ERROR);
          }
        } else {
          return new PluginResult(PluginResult.Status.INVALID_ACTION);
        }
      } catch (JSONException e) {
        return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
      }
    }
  }
  </code></pre>
  
  <hr>
  
  <h2>HTML/JS Code</h2>
  
  <pre><code>&lt;script type="text/javascript" src="cordova-2.1.0.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    window.echo = function(str, callback) {
      alert('Started');
      cordova.exec(callback, callback, "MyTestPlugin", "echo", [str]);
      alert('The END');
    };
    window.onload = function () {
      alert('1st Step');
      window.echo("echo", function(echoValue) {
        alert(echoValue == "echo"); // should alert true.
      });
      alert('SecondStep');
    };
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <hr>
  
  <h2>Config.xml</h2>
  
  <h2>    </h2>
  
  <p>But I am not able to invoke the plugin. Can somebody please help me in getting this issue rectified?</p>