0

I am creating layouts for targeting my application for all screen sizes and densities (including tablets 7,9.1 and 10 inches). I have a few queries for which I haven't been able to understand well even though after reading the documentation. Currently, I have made four layouts namely layout-large,*normal*,small,*-sw320dp* and -sw480dp. I am confused about images densities.

I am referring to the image that android provides by default (ic_launcher.png under drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xhdpi and drawable-xxhdpi.) I have made a sample layout taken a image view and given src as ic_launcher.png. However, this image is not displayed on any device or emulator.

  1. Do I need to specify different sized images? If so, in which folders? Because layouts for larger screens should take larger images.
  2. Do hdpi, ldpi, and mdpi imply similar sized images with different density or images with different sizes only?
  3. Also in case of layout for larger screen, should I refer to drawables for large sized images (if I am taking small, medium, large images), or will Android take it from drawable-hdpi?
apaderno
  • 28,547
  • 16
  • 75
  • 90
Joyson
  • 1,643
  • 5
  • 28
  • 48
  • Please try to frame your question in such a way that some one will actually want to solve it. you may seem that this is a rude remark but proper formatting will help you get better answers for your problems. :) – Deepak Senapati Jul 11 '13 at 09:51
  • http://stackoverflow.com/a/17585605/1835764 – Nirmal Jul 11 '13 at 09:59
  • http://developer.android.com/guide/practices/screens_support.html check this – Sugan S Jul 11 '13 at 10:02
  • http://developer.android.com/training/multiscreen/screensizes.html this also can help you – Sugan S Jul 11 '13 at 10:02
  • But why is it not showing the image on any of the devices or emulator if android takes the image at runtime.Any of the devices will still come under a category as mentioned above – Joyson Jul 11 '13 at 10:50
  • in think the problem is in your xml file. not in the folder. make textview instead of imageview to check whether it is working or not!!! – Nirmal Jul 11 '13 at 10:56
  • Nirmal i added a text view as well and i have named them differently like for small screen textview is named as small and so forth that works perfectly however only the problem comes in case of image.Only image is not displayed it shows as blank – Joyson Jul 11 '13 at 10:59
  • can you see an image in normal screen? have you tested all the screen size? – Nirmal Jul 11 '13 at 11:07
  • No Nirmal though for normal screen text that i have mentioned as normal is displayed however the image is not displayed – Joyson Jul 11 '13 at 11:16
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/33261/discussion-between-nirmal-and-joyson) – Nirmal Jul 11 '13 at 11:28

1 Answers1

0

You only need to put the images in the right folder: using hdpi + mdpi + xhdpi + xxhdpi

ldpi is only 1% of the android devices and you should not make them.

you also can create different layouts for larger screens

read here for more info

ridoy
  • 6,274
  • 2
  • 29
  • 60
Lukas Olsen
  • 5,294
  • 7
  • 22
  • 28