1

I am testing my android app in Oracle VM Virtual Box, i'm using normal screen mode with dimension 320x480x16.

When i launch the app the layout is correctly fetched from layout-large folder but the images are always fetched from drawable-hdpi. I am newbie to this concept. I have read some article but i am still confused. Can anybody tell me how to change/set the dpi in Oracle VM Virtual Box from the command line?

DArkO
  • 15,880
  • 12
  • 60
  • 88
Najeebullah Shah
  • 4,164
  • 4
  • 35
  • 49
  • Here check for DPI boot option: http://stackoverflow.com/questions/6202342/switch-android-x86-screen-resolution – Borzh Apr 02 '15 at 19:51

1 Answers1

1

I don't believe your layout is large. large is used for screens that have about 7 inch displays.

As far as creating an emulator with a specific DPI you can choose the DPI when creating a new emulator with AVD. the emulator control app is located in the SDK folder.

The Hardware option you need is called Abstracted LCD density.

see this to find out a bit more about densities. The default is set to 240 which is a HDPI screen, you can lower it for mdpi or increase it for xhdpi.

Also consider this: a extra large screen like a 10inch tablet (motorolla xoom for example) has a xlarge layout but mdpi density. So in other terms bigger resolution or size doesn't always mean more dense screens.

DArkO
  • 15,880
  • 12
  • 60
  • 88
  • fine, if my mdpi drawable contains 36x36 image then other three hdpi, ldpi, xhdpi should contain images with what dimensions. or will it be the density that increases or decreases in the three drawables making images dimension the same – Najeebullah Shah Jul 23 '12 at 07:05
  • 1
    Lets say mdpi is 1px. then hdpi would be 1px * 1.5 = 1.5 px, ldpi would be 1px * 0.75 = 0.75px and xhdpi would be 2* 1px = 2px. These are the drawable ratios that you will need to provide. Now in order that you don't provide a resource for example in the hdpi folder but you have that image in mdpi, for hdpi devices android will decide to take the most appropriate item, in this case from mdpi and scale it up to fit hdpi. The main reason that you need to provide appropriate resources is the actual quality of the resources. – DArkO Jul 23 '12 at 08:35