androidscreens

Supporting multiple screens in android


I have developed a game in android,but i'm facing many problems with the screen sizes I heard that we should create separate folders like(layout-small,layout-normal,layout-large,layout-xlarge) in the res folder and should maintain all xml files in them.

But my confusion is how to retrieve particular xml from particular layout folder what is the code should be written in the Activity..? Please help me to solve this by an example. Thanks


Solution

  • you dont choose from which folder you read the xmls. Android does it for you depending on the dpi and the size of the screen its running on.

    This is what helped me: http://android-developers.blogspot.in/2011/07/new-tools-for-managing-screen-sizes.html