Java : Get size and orientation of android device


// First, you need to get the Display from the WindowManager
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();

// Now you can call all display-related methods
int width = display.getWidth();
int height = display.getHeight();
int orientation = display.getOrientation();

Comments

Popular posts from this blog

Offers on Friday, April 24, 2020

Fatal: LoadModule: error loading module 'mod_sql_mysql.c'