Write first class, make tests and took a coffee to understand freaking cordova-plugin ecosystem

This commit is contained in:
Michael Bykovski
2017-07-07 12:41:22 +02:00
parent 1cae514078
commit 2198a81f0b
8 changed files with 170 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package org.apache.cordova.plugin;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* This class echoes a string called from JavaScript.
*/
public class Webserver extends CordovaPlugin {
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
if ("start".equals(action)) {
callbackContext.success();
return true;
}
return false; // Returning false results in a "MethodNotFound" error.
}
}