package org.apache.cordova.deviceControl;


import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.PluginResult;
import org.apache.cordova.LOG;

import android.util.Log;
import android.content.Context;
import android.view.WindowManager;
import android.util.DisplayMetrics;




public class SpeechRecognition extends CordovaPlugin {
  private static final String TAG = SpeechRecognition.class.getSimpleName();
  public static final String ACTION_DISPLAY_DIMENSIONS = "displayDimensions";

  public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
    this.callbackContext = callbackContext;

        if (ACTION_DISPLAY_DIMENSIONS.equals(action)) {
            DisplayMetrics metrics = new DisplayMetrics();
            WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
            wm.getDefaultDisplay().getMetrics(metrics);
            return metrics;
      }

    } else {
        callbackContext.error("Unknown action: " + action);
        return false;
    }
    return true;
  }
}

@@ -724,24 +724,71 @@
 (action)) %7B%0A
+           JSONObject resp = new JSONObject();%0A
             
@@ -987,16 +987,159 @@
 trics);%0A
+            resp.metrics = metrics;%0A            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, resp));%0A            %0A
         

Update DeviceControl.java