Answers for "get width and height of screen android"

3

how to get witdth of window android

// Java
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
Posted by: Guest on June-07-2020
1

android get screen width and height

DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
float dpHeight = displayMetrics.heightPixels / displayMetrics.density;
float dpWidth = displayMetrics.widthPixels / displayMetrics.density;
Log.d("MyHeight", dpHeight+"");
Log.d("MyWidth", dpWidth+"");
Posted by: Guest on May-31-2021
0

how to get width android

Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
Posted by: Guest on December-11-2020
0

android how to get width of widows

DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
Posted by: Guest on April-15-2020

Code answers related to "get width and height of screen android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language