title: Using cordova plugin with a native Android interface
body: <p>I wrote a Cordova plugin for Android to build a phonegap app with an HTML5 GUI.</p>
  
  <p>I now want to have a native interface too and was wondering what is the neatest option to reuse my plugin for the native UI. Basically I would like to have two apps, one with a phonegap (HTML5) interface and one with a native Android interface, both of them using the Cordova plugin.</p>
  
  <p>The plugin extends the <code>CordovaPlugin</code> class, so for this reason I don't know how to use it without calling the following method from the javascript in the <code>WebView</code>, as described here <a href="http://docs.phonegap.com/en/2.3.0/guide_plugin-development_android_index.md.html" rel="nofollow">http://docs.phonegap.com/en/2.3.0/guide_plugin-development_android_index.md.html</a></p>
  
  <pre><code>exec(&lt;successFunction&gt;, &lt;failFunction&gt;, &lt;service&gt;, &lt;action&gt;, [&lt;args&gt;]);
  </code></pre>
  
  <p>I just want to call the native side of the plugin without going through a <code>WebView</code>:</p>
  
  <pre><code>@Override
  public boolean execute(String action, JSONArray args,
          CallbackContext callbackContext) throws JSONException { ... }
  </code></pre>
  
  <p>Provided that I could just adapt the code from the plugin fairly easily, I would like to find a method by which the plugin remains exactly the same for better decoupling of frontend/backend (I could change the code in one app without the need to replicate it in the other app). </p>
  
  <p>Is this possible at all? I understand this is not the point of having a Cordova plugin, but I would like to find a way around it. </p>
  
  <p>Thanks.</p>