2010년 12월 30일 목요일

[Android Course][English][Theme] - Screen Resolution (Size) to obtain




Of the Android API, how to obtain the screen size is shown below.

1. 'Metrics' Use.
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int deviceWidth = displayMetrics.widthPixels;
int deviceHeight =displayMetrics.heightPixels;

2. 'Display' Use.
Display display = getWindowManager().getDefaultDisplay();
int displayWidth = display.getWidth();
int displayHeight = display.getHeight();

In addition, inquiries, or questions, please contact us.
(joonryang@gmail.com)

댓글 없음:

댓글 쓰기