CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2017-04-07
by Rhn Bhadani

Original Post

Original - Posted on 2011-07-05
by evilone



            
Present in both answers; Present only in the new answer; Present only in the old answer;

If you want the display dimensions in pixels you can use this code:
Display display = getWindowManager().getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight();
Then you can add condition that compares the height to satisfy your needs.
In inches:
DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); double x = Math.pow(dm.widthPixels/dm.xdpi,2); double y = Math.pow(dm.heightPixels/dm.ydpi,2); double screenInches = Math.sqrt(x+y); Log.d("debug","Screen inches : " + screenInches);
If you want the display dimensions in pixels you can use this code:
Display display = getWindowManager().getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight();
Then you can add condition that compares the height to satisfy your needs.
In inches:
DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); double x = Math.pow(dm.widthPixels/dm.xdpi,2); double y = Math.pow(dm.heightPixels/dm.ydpi,2); double screenInches = Math.sqrt(x+y); Log.d("debug","Screen inches : " + screenInches);


        
Present in both answers; Present only in the new answer; Present only in the old answer;