Search code examples
androidandroid-layoutandroid-screenandroid-screen-support

Android application could not run properly on screen sizes less than 4 inch


I'm developing a small application but I'm having problem while deploying the application on screen sizes smaller than 4 inches. I have tried it on a 3.2 inch screen, the whole layout is mixed up with each other. I have searched for this problem a lot of time and tried some of the methods like making folders with layout-small, layout-normal and layout-large. This does not give me the proper layout.

And one more thing I could not decide which images to put in ldpi or mdpi or hdpi. Right now for better image resolution I'm putting all the images in hdpi folder. Is this way a correct way to develop an android application?


Solution

  • Screen size and screen density are separate issues

    For small screen use a separate layout file res/layout-small/main.xml Your drawable assets could be in appropriate folder depending on the density of the device.

    e.g sony xperia mini is a xhdpi device while more of the other devices with 3.2 screen might be ldpi or mdpi devices.