views:

46

answers:

2

There are the following layout options to create interfaces for android.

AbsoluteLayout FrameLayout LinearLayout TableLayout RelativeLayout (and some more)

Which of the following is most suitable for designing simple games? Guessing that the absoluteLayout is easiest, but will it be problems with different screen sizes? What do you recommend?

A: 

Using AbsoluteLayout will give you the most control where your views will be placed. However I recommend using RelativeLayout. This will be much more screen size and density independed.

You can use different layouts for different screen sizes or densities. Also make sure not to place your views using abosolute pixels (px), rather use device independet pixels (dp or dip). Those will be automatically scaled for different densities.

There is a lot about this in the official docs: http://developer.android.com/guide/practices/screens_support.html

StefanMK
A: 

I've been avoiding AbsoluteLayout, because it's deprecated: http://developer.android.com/reference/android/widget/AbsoluteLayout.html

androidSquakmtCom
Do you also recommend relative layout?Are the other options in addition to absolute layout ok to use or they can also cause problems?
Martin