Question

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 developing 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.

Was it helpful?

Solution

you can retrieve the device screen dimension with this

            getResources().getDisplayMetrics();
        getResources().getDisplayMetrics().widthPixels;
        getResources().getDisplayMetrics().heightPixels;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top