Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flexible android layout for multiple screen sizes/densities

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?

like image 343
Innova Avatar asked Feb 26 '23 09:02

Innova


1 Answers

firstly, I'm sorry my English is not good enough. You should divide your resources into some folders (based on screen size), for example, make different layouts from different resources. You can do like below:

1.drawable

-drawable-hdpi

-drawable-mdpi

-drawable-ldpi

2.layout

--layout-hdpi

--layout-mdpi

--layout-ldpi

customize your resource for each screen size, it makes your application is applicable for many device.

like image 146
oloan sembiring Avatar answered Apr 25 '23 11:04

oloan sembiring