1

Iam developing an Android app using Android Studio, I referred this link to use different images resources but i failed to get the output.

What i need is "I have 480x640_240dpi, 480x800_240dpi, 480x854_240dpi, 600x1024_240dpi in my drawable-hdpi folder", but while running the app the images are stretching.

How to detect the correct resolution image to the corresponding device. And also help me how to add images to the tablet (that too only in landscape mode, in my app tablet wont work on portrait as requirements). Thanks in Advance.

Community
  • 1
  • 1

2 Answers2

2

Targeting specific resolutions is possible with resource directory qualifiers. For example you can create folder drawable-w320dp-h533dp-hdpi for 480px x 800px image on hdpi screen.

EDIT: Since you probably are using Android Studio, you can define the qualifiers in the dialog when you are creating new resource directory.

Lamorak
  • 10,957
  • 9
  • 43
  • 57
1

Put your all images according to the resolutions. i.e

  • res/drawable-mdpi/graphic.png // bitmap for medium-density
    res/drawable-hdpi/graphic.png // bitmap for high-density
    res/drawable-xhdpi/graphic.png // bitmap for
    extra-high-density res/drawable-xxhdpi/graphic.png // bitmap
    for extra-extra-high-density

for more detail http://developer.android.com/guide/practices/screens_support.html

luckwithu
  • 143
  • 4