download:React 配置化+Serverless 开发个人博客
import org.json.JSONArray;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.phonegap.api.PhonegapActivity;
import com.phonegap.api.Plugin;
import com.phonegap.api.PluginResult;
public class PluginTest extends Plugin { public static String ACTION = "hello";
public PluginTest() {
}
@Override
public PluginResult execute(String action, JSONArray args, String callbackId) {
try {
JSONObject jsonObj = new JSONObject();
if (action.equals("hello")) {
String str1= args.getString(0);
String str2= args.getString(1);
jsonObj.put("str1", str1+"1");
jsonObj.put("str2", str2+"2");
}
PluginResult r = new PluginResult(PluginResult.Status.OK,jsonObj);
return r;
} catch (Exception e) {
e.printStackTrace();
}
}