Skip to content

Instantly share code, notes, and snippets.

@laaptu
Created December 4, 2013 07:12
Show Gist options
  • Select an option

  • Save laaptu/7783545 to your computer and use it in GitHub Desktop.

Select an option

Save laaptu/7783545 to your computer and use it in GitHub Desktop.
Device Screen Width Height
WindowManager windowManager =(WindowManager)getSystemService(Context.WindowService);
DisplayMetrics displayMetrics = new DisplayMetrics();
windowManager.getDefaultDisplay().getMetrics(displayMetrics);
int screenWidth = displayMetrics.widthPixels;
int screenHeight = displayMetrics.heightPixels;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment