title: Creating a helloWorld plugin for Android using Cordova and Eclipse
body: <p>I've done quite a bit of research and can't seem to find why this isn't working.  What I have is Cordova based Android app in Eclipse running Cordova 2.7.0.  I want to build a simple plugin that just alerts the user when it has completed. </p>
  
  <p>My index.html</p>
  
  <pre><code>    &lt;head&gt;
      &lt;script type="text/javascript" src="cordova-2.7.0.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          window.func = function(str,callback){
              alert("Outside Call Working");
              cordova.exec(callback, function(err){alert(err)},"HelloPlugin","echo", [str]);
          }
          function callPlugin(str){
              alert("JS Working");
              window.func(str,function(){
                  alert("Done!");
              });
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h2&gt;PluginTest&lt;/h2&gt;
      &lt;a onclick="callPlugin('Plugin Working!')"&gt;Click me&lt;/a&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>My config.xml line where I add the plugin</p>
  
  <pre><code>&lt;plugin name="HelloPlugin" value="org.apache.cordova.plugin.HelloPlugin" /&gt;
  </code></pre>
  
  <p>And my actual plugin HelloPlugin.java that is in src/com/example/plugintest right next to MainActivity.java</p>
  
  <pre><code>package com.example.plugintest;
  
  import org.apache.cordova.api.CallbackContext;
  import org.apache.cordova.api.CordovaPlugin;
  import org.json.JSONArray;
  import org.json.JSONException;
  
  public class HelloPlugin extends CordovaPlugin{
  
      @Override
      public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
          /*if(action.equals("echo")){
              String message = args.getString(0); 
              callbackContext.success(message);
              return true;
          }*/
          callbackContext.success(action);
          return true;
      }
  }
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>