package com.appgyver.plugin;

import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.CallbackContext;
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 Echo extends CordovaPlugin {
    @Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
        if (action.equals("echo")) {
            String message = args.getString(0);
            this.echo(message, callbackContext);
            return true;
        }
        return false;
    }

    private void echo(String message, CallbackContext callbackContext) {
        if (message != null && message.length() > 0) {
            callbackContext.success(message);
        } else {
            callbackContext.error("Expected one non-empty string argument.");
        }
    }
}
@@ -49,20 +49,16 @@
 cordova.
-api.
 CordovaP
@@ -90,20 +90,16 @@
 cordova.
-api.
 Callback
@@ -137,12 +137,8 @@
 ova.
-api.
 Plug
@@ -951,8 +951,9 @@
 %0A    %7D%0A%7D
+%0A

Update Echo.java