麻烦提供一下公式,谢谢!

解决方案 »

  1.   


    private void getScreenSizeOfDevice2() {  
        Point point = new Point();  
        getWindowManager().getDefaultDisplay().getRealSize(point);  
        DisplayMetrics dm = getResources().getDisplayMetrics();  
        double x = Math.pow(point.x/ dm.xdpi, 2);  
        double y = Math.pow(point.y / dm.ydpi, 2);  
        double screenInches = Math.sqrt(x + y);  
        Log.d(TAG, "Screen inches : " + screenInches);  
    }  参考链接
      

  2.   


    算下来不对,实际尺寸5.51inch,程序算下来9.158inch
      

  3.   

    xdpi,ydpi是160,densityDpi是320,手机被修改过信息吧,不然不会是这个值的。