0

I have a problem with my app.

I had lower resolution images to load in smartphone, when I tested the app on tablet did not look good and increase the resolution of the images, but now in smartphone space memory fails and it blocked the app when I try to access a view to these images.

I wanted to know how I can fix this problem and I have in the project directory 'res' images that serve to both dispositives without problem.

I've heard that with suffixes drawable folders (drawable-hdpi, drawable-mdpi, etc.) are used to take pictures of different resolutions and automatically each device take pictures from a directory or another, but I only use images in the drawable directory -mdpi. In that case, what job directory for each type of device?

Thank you.

KryNaC
  • 379
  • 4
  • 21
  • Look at this answer : http://stackoverflow.com/a/14215922/1405983. And also official document : http://developer.android.com/guide/practices/screens_support.html – Hardik Joshi Oct 18 '13 at 09:17
  • This might help - http://developer.android.com/guide/practices/screens_support.html – Traxex1909 Oct 18 '13 at 09:21
  • You can store the images with different resolution in respective drawables folder like drawable-ldpi , mdpi, hdpi, xdpi and xxhdpi... The image sizes will be.. let x be for mdpi for hdpi = 1.5x; xhdpi = 2x; xxhdpi = 3x – Himanshu Joshi Oct 18 '13 at 09:31
  • ok thanks, but ... what directory I must use for each device? drawable-mdpi for smartphone and drawable-hdpi for tablet? – KryNaC Oct 18 '13 at 10:17
  • http://stackoverflow.com/questions/14272110/tablet-drawable-qualifier – Shivang Trivedi Oct 18 '13 at 10:20

1 Answers1

0

If you are developing an app in which you want to support both phones and tablets gracefully

then you have to

  • Explicitly declare in the manifest which screen sizes your application supports
  • Provide different layouts for different screen sizes
  • Provide different bitmap drawables for different screen densities

for more Docs

You have to place different images in the respective drawable folders.

i.e

drawable-hdpi
drawable-ldpi
drawable-mdpi
drawable-xhdpi
drawable-xxhdpi

for tablets you can specify different layout

i.e

layout-large
layout-xlarge

res/layout-sw600dp/   // For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/   // For 10” tablets (720dp wide and bigger)

with

drawable-large
drawable-xlarge
Jeffy Lazar
  • 1,903
  • 13
  • 20