2

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!

user1513687
  • 173
  • 2
  • 13
  • http://www.youtube.com/watch?v=kFhgmS2Kc7k. You should go through the video in this link. Multiversioning and supporting multiple screens. – Raghunandan Oct 19 '12 at 15:45

1 Answers1

5

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.

Khantahr
  • 8,156
  • 4
  • 37
  • 60
  • I mainly just want to scale. I am going to lock my app to vertical only because the horizontal is going to take a lot of time to configure. So I will just render out those resolutions and add them to the files, then it should be good? – user1513687 Oct 19 '12 at 14:58
  • You'll just need one set out layouts, put it in the "layout" folder and set it to portrait only in the Manifest. Assuming you stick to only sp and dp you're good to go. – Khantahr Oct 19 '12 at 15:02
  • Accept my answer if it answers your question please, the checkmark next to it. :-) – Khantahr Oct 19 '12 at 15:10
  • I had to wait until the wait was up. Sorry about that! – user1513687 Oct 19 '12 at 15:14
  • No worries, just didn't know if you knew about that feature. – Khantahr Oct 19 '12 at 15:20
  • I actually have another question. Does it matter which resolution pics I use to build the app? Do I just name them the same things, but put them in different directories? – user1513687 Oct 19 '12 at 15:37
  • The actual resolution is something you'll have to determine yourself based on what you want it to look like. Once they're created, name them each the same, put the hdpi one in the drawable-hdpi folder and the mdpi one in drawable-mdpi, etc. – Khantahr Oct 19 '12 at 15:39