Search code examples
androidandroid-layoutandroid-screen-support

Best way to support multiple screens? - Android


I have been working on my app for several months now, and it is about ready to be released. I have one more thing to do, which is to make it support multiple screens. I have read the the android developer documentation many times, but I am still confused as to what the best way to implement this might be.

Should I create multiple layout files for each screen type & resolution I want to support? If I did that, then I would have to render multiple pictures for each resolution and that would be cumbersome for someone to download.

Thanks for the help in advanced!


Solution

  • If you want different layouts for different screens, then yes, you'll need separate layouts for each. If you want the same layouts to just scale, then all you need to do is make sure all of your sizes are in dp or sp, don't use px anywhere. Android will take care of the rest.

    As far as images go, you should have them in different resolutions even if you don't have separate layouts so they look better in varying screen densities. I'd say at least have mdpi and hdpi resolutions of each image.