display on multiple android screens

130 views Asked by At

i have write a custom view and i used the onSizeChanged() to take the width and height of the phone.when everything seems right in the emulator i installed on the phone(htc desire) and i don't have the same results!

what can i do to support different screens than one?onSizeChanged shouldn't give me the solution?

2

There are 2 answers

1
ykatchou On BEST ANSWER

You have to take care of the pixel density and the number of pixels.

Everything is here : http://developer.android.com/guide/practices/screens_support.html

0
manfcas On

The answer depends a lot on your layout, and without more details the best thing to start is obviously the official tutorial.

The first thing to know, is the set of devices you want to support. Is your app only for smartphone? Tablets? Both? And then, which screen sizes, resolutions and densities you want to support? You want your app to gracefully adapt to the unsupported devices, or you want it to be hidden on the Play Store?

In general, you shouldn't do the work on the Java side, but more on the resources side (even if sometimes is not possible).