Code example for Display

Methods: getHeightgetMetricsgetWidth

        WindowManager w = getWindowManager();
        Display d = w.getDefaultDisplay();
        DisplayMetrics metrics = new DisplayMetrics();
        Log.d("WIDTH: ", String.valueOf(d.getWidth()));
        Log.d("HEIGHT: ", String.valueOf(d.getHeight()));
        WindowManager windowmanager = (WindowManager)getSystemService(WINDOW_SERVICE);
        Display disp = windowmanager.getDefaultDisplay();
        int width = disp.getWidth();
        int height = disp.getHeight();
        Log.d("Java", "disp.w=" + width + " h=" + height);
        JsInterface jsInterface = new JsInterface();
        //get webview and enable js 
        wv = (WebView) findViewById(;
Stop searching for code, let great code find you!  Add Codota to your java IDE