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();


Popular posts from this blog

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

How to hide Android Soft Keyboard