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

There was a problem saving your changes. Please try again later.

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