Yahia
Yahia

Reputation: 691

build dynamic android layouts

am trying to build android app with a dynamic layout to support multiple screens

am thinking about build all my app for a certain device with a fixed dimensions like Motorola Droid , say that the button will be 50 width 50 height

and after i finished all the app , i will reedit the sizes of elements to be a ratio betweetn the right place of them and the dimensions of the new device

also Drawables will be Scalable Drawables and i will use only the Drawables folder and remove others : - drawable-hdpi - drawable-ldpi - drawable-mdpi

so i will have only one Drawables folder and only one layout xml file for every activity

and most of my layouts will be hard coded using java

so the question is : is it a true method for development ?!

may be you will ask , why ?

so my answer is , as i think my method is easer than using :

Upvotes: 0

Views: 1197

Answers (2)

Dev.Sinto
Dev.Sinto

Reputation: 6862

AFAIK you can manage resoution variation of different devices by keeping the images in drawable-hdpi,drawable-mdpi,drawable-ldpi folder. then screen sizes by providing different layout for different screen size categories by specifying layout-small,layout-large,layout-xlarge. also you can increase number of devices supported by using nine patch and relative layout check this google official documentation regarding this topic.

hope this help.

thanks.

Upvotes: 1

Phil
Phil

Reputation: 36289

The simplest (and probably the best) way to create layouts that support all screen sizes is to use a RelativeLayout.

Upvotes: 1

Related Questions