views:

77

answers:

2

All pages of my application use the AbsoluteLayout which is deprecated. I was told that the reason i should not use absolutelayout is that it's not flexible in different screen sizes.

I tested my app with every simulator comes with android sdk, and I had no problem. But all screens on all simulators seem to have the same size. am i safe to go with absolute layout as long as it works on all simulators? 1.1, 1.5, 1.6, 2.0, 2.0.1, 2.2, 2.2

+2  A: 

You can set screen size when creating AVD (by changing Skin Default HVGA to some other). And you can also change orientation pressing 7 and 9 keys on numeric keyboard.

Gawcio
Yeah definitely test with hvga, qvga, and wvga to see the effect of scaling on your UI.
keno
I don't want my app to run in different orientation, I only want it to run in landscape , 1 side.Is it possible to force this?Thank for the answer by the way i'm going to try different screen sizes
aryaxt
To force landscape put android:screenOrientation="landscape" as attribute of Activity into AndroidManifest.xml
Gawcio
+2  A: 

If all screens on all simulators seem to have the same sizem it's because you are not changing it's resolution at the moment of create them. See Gawcio's response.

am i safe to go with absolute layout as long as it works on all simulators?

No, you are not. You must stop using AbsoluteLayout... there are better ways to build your application.

Cristian
The official replacement for `AbsoluteLayout` is to write your own layout manager class that implements your rules.
CommonsWare
Or RelativLayout with use of margins.
Gawcio
"You can achieve much the same layout by using a FrameLayout instead, and setting layout_margin attributes of the children. This approach is more flexible and will yield better results on different screens."
aryaxt