I am working on creating a card game for android. I am trying to come up with a layout that will allow the game to be played on all screen sizes and densities.
I have read: http://developer.android.com/guide/practices/screens_support.html
However, I am still confused on the best way to do this.
For this game, I need the cards laid out in landscape mode, in 5 columns. There are places above the 5 columns for additional cards. It is very similar to solitaire in this respect…but I only have need for 5 columns instead of 7.
What size card images should be in ldpi, mdpi, and hdpi?
What type of layout should I use (Table, Linear, Relative)?
Should I create different layouts for the different screen sizes (small, normal, large)?
Any examples you can point me to?
The android documentation has a great guide on the subject:
Supporting Multiple Screens
They introduce generalized sizes and densities and show how different resources can be loaded dynamically for different screens.
I’m new to android myself, so don’t take my word for it, but, I think you can get away with one layout for all screen sizes, and I think RelativeLayout will work well (in most cases), especially with something as complex as a card game. I’ve mainly used LinearLayouts inside RelativeLayouts when I’ve wanted to align buttons/text horizontally.