Determining App's Window/Screen Size
How do you determine the size of a component rather than calculating the sizes of all components including the screen and the parent component's sizes of the component?
I have developed a few apps using android 1.6 but all of them are based on the screen size of the target phones. Since Android is not like Symbian OS, I believe I can create an app that can be installed to any phone running Android OS as long as OS versions are honored.
Say, I am d开发者_如何学Ceveloping for HTC Desire HD. How do I know what should be the window screen size in pixels knowing that Desire has a screen dimension of 4.3 inches?
Thanks.
you can retrieve the device screen dimension with this
getResources().getDisplayMetrics();
getResources().getDisplayMetrics().widthPixels;
getResources().getDisplayMetrics().heightPixels;
精彩评论