Rajeev
Rajeev

Reputation: 46919

Android Images for various devices

I have question regarding Android Layouts.I have read the documentation of Layouts .My question is that while developing lets say if the images are placed in the folders named

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

Does drawable-ldpi refers to the phones with smaller screen ,drawable-xhdpi for tabs and drawable-mdpi medium sized screen phones.

If not i have a image i need to be able to put into all types of devices namingly phone,tab

How can i do it.

Upvotes: 0

Views: 86

Answers (2)

Jeffrey Blattman
Jeffrey Blattman

Reputation: 22637

usually, larger screens have higher DPIs, but that is not always the case. if you are trying to differentiate between phone and tablet screens, density is not the right way. use the following,

  • drawable: phones
  • drawable-sw600dp: 7" tablets
  • drawable-sw720dp: 10" tablets

alternatively, you can use the screen size: small, medium, large, xlarge. e.g., drawable-large. from the docs,

  • xlarge screens are at least 960dp x 720dp
  • large screens are at least 640dp x 480dp
  • normal screens are at least 470dp x 320dp
  • small screens are at least 426dp x 320dp

http://developer.android.com/guide/practices/screens_support.html

Upvotes: 2

cjk
cjk

Reputation: 46425

Googling Android xhdpi brings up the Android resource on how you should use these:

http://developer.android.com/guide/practices/screens_support.html

DPI means how many dots per inch there are. Some small phones fit lots of dots in, which gives them a high DPI. You should provide different sized images for different resolutions. Google recommends creating images in the ration of 3:4:6:8 for l, m, h and xh DPIs.

Upvotes: 1

Related Questions