I am trying to simply test my app under a QVGA setting, but 95% of the time when I run the QVGA emulator I created, it loads the resources associated with HVGA. I have custom bitmaps that I include in my app, so it's crucial for me to be able to verify the appearance.
To see what the density was being treated as, I added the following code and displayed the results in a Toast:
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
// will either be DENSITY_LOW, DENSITY_MEDIUM or DENSITY_HIGH
int dpiClassification = dm.densityDpi;
// these will return the actual dpi horizontally and vertically
float xDpi = dm.xdpi;
float yDpi = dm.ydpi;
Output was -> DensityClass = 160 - xDpi = 164.75 - yDpi = 165.88
Perhaps I am simply misunderstanding, but for starters, shouldn't the density class have a value of 120?
I created a QVGA emulator in the AVD manager with the following settings:
Target: 1.6 level 4
Hardware Property: Abstracted LCD Density = 120 (verified in config.ini file)
In my Manifest file, I added the following:
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
In my res folder, I have:
drawable
drawable-hdpi
drawable-ldpi
drawable-mdpi
Can someone tell me why the emulator is not loading the low density drawables? The drawables in this QVGA emulator are the same exact size as the drawables in the HVGA emulator (not what I want), and yes, I scaled down the pictures before adding them to the LDPI folder (drastically smaller). For no apparent reason, once in a while the emulator will actually load properly and everything displays correctly, but again, this only happens about 5% of the time with no apparent reason for why.