1

enter image description here

I'm developing a welcome page for my application that would display a full screen image in an activity, along with two buttons. Very much like the welcome screen of Instagram. I understand that you have images for these modes in Android namely ldpi, mdpi, hdpi, and xhdpi. So my question is, what are the each modes maximum resolution and how do I create images that don't stretch up on multitude of screen resolutions and DPI settings? I've read the official Android guide, supporting multiple screens, though much useful, the article didn't answer my question. Hoping to learn it from here.

Thank you! PS: I won't be supporting landscape orientation for welcome screen of my application.

Basit
  • 1,830
  • 2
  • 31
  • 50
  • You will get screen sizes in eclipse ide. Make large size psd's for all required images then you can down scale those as per your need. – VVB Jul 16 '14 at 09:28
  • be aware, a fullscreen image like this is going to be comparatively large - it'll likely be enough to provide one image for the highest res you're supporting (put it in that directory, e.g. `drawable-xxhdpi`), and letting the system scale it _down_ – ataulm Jul 16 '14 at 09:40
  • @ataulm Interesting approach. What would be the resolution of such an image, so it supports the highest of screen densities without scaling UP? – Basit Jul 16 '14 at 15:36
  • 960x600dp will cover small tablets. Assuming XXHDPI, it'll be 2880x1800px. Clearly this is super large. You'll need to trade off between crazy high res/size and how much value this brings to the UX. – ataulm Jul 16 '14 at 15:45
  • Yikes! An image this large as a loss-less PNG resource would alone be more thana couple of MBs at least. – Basit Jul 16 '14 at 15:55
  • let it scale up, 640px (long side) is probably good enough – ataulm Jul 16 '14 at 22:01

2 Answers2

1

Well, basically you have different screen densities in android, so you need to add images in different resolutions on each drawable folder, for instance:

  • xlarge screens are at least 960dp x 720dp (drawable-xhdpi)
  • large screens are at least 640dp x 480dp (drawable-hdpi)
  • normal screens are at least 470dp x 320dp (drawable-mdpi)
  • small screens are at least 426dp x 320dp (drawable-ldpi)

Check out this documentation.

José Barbosa
  • 913
  • 8
  • 17
  • So I should create image sizes of these resolution and put them them respective drawable folder, right? That would prevent Android from scaling/stretching up my image, yes? – Basit Jul 16 '14 at 09:46
  • yes, now you have xxhdpi and xxxdpi, check them too. Just define your view background as this image.. – José Barbosa Jul 16 '14 at 09:55
  • How about just creating the image with the highest resolutions of the highest densities, i.e. xxxhdpi and putting it in drawable folder. The system should be able to scale down the image for lower densities, no? – Basit Jul 16 '14 at 15:42
  • you can do it (place the img in "drawable" folder), but the scaled image may not look good – José Barbosa Jul 16 '14 at 17:43
  • So what should be the best alternative here? Create six separate drawable-density folders and six separate image files? – Basit Jul 17 '14 at 03:23
  • All right. And what would be the image resolution for xxxhdpi screen density? – Basit Jul 17 '14 at 09:29
  • I think xxxhdpi is not used yet, but is something like 2560px x 1536px – José Barbosa Jul 17 '14 at 10:46
  • I still don't have the actual image sizes :( – Basit Jul 18 '14 at 15:10
-1

For that What ever the images you take that should be vector images so that it is looking good not blurred. And Generate all the images by using 9 patch generate. If you want stretch.

And for the layout write the code by using weight and weight some So that will comes good. For more details please read this. http://www.7solutions.in/2013/10/weightweight-sum-in-android.html

Nava2011
  • 195
  • 1
  • 15