tags:

views:

40

answers:

2

Hi all,

All these days i used to test my application on my HTC Legend (2.1 OS) only, and i had all my images resources in drawable-hdpi folder.. and everything worked fine

and today i wanted to test my Application on Android 1.5, so i recreated all the images with lower resolution and kept it under drawable-mdpi folder, so now i have High resolution images in drawable-hdpi folder and lower resolution images in drawable-mdpi folder..

Everything looked great on both the HTC Legend and Emulator(with Android 1.5)

Later i found out that the images in drawable-mdpi are shown in my HTC Legend too and not the images in drawable-hdpi

in my manifest file i have also included

<uses-sdk android:minSdkVersion="3" />
<supports-screens android:anyDensity="true" />

Can anyone help me with this, I want to know as to why the images in drawable-hdpi are not used?

+1  A: 

Try removing

 <supports-screens android:anyDensity="true" />

UPD:

Just noticed that Legend is MDPI device (Resolution: 320 X 480 HVGA). So the question is incorrect, your application behaves as it is expected to behave.

Look at the section http://developer.android.com/intl/zh-TW/guide/practices/screens_support.html#range to become educated on android device sizes and densities.

Konstantin Burov
I tried it.. and it didnt work :(
Amith GC
Have you tried also to add target sdk version as @Rahul advices? Probably set it to 7 or even 8.
Konstantin Burov
Sorry, it didnt work, I have an image x.png in drawable-mdpi (red in color)and I have an image x.png in drawable-hdpi (blue in color)Expecting the blue color'd image to load in my HTC Legend (2.1) and Red Color'd image in Emulator (OS 1.5)
Amith GC
Why do you expect hdpi image on Legend? Legend is mdpi device.
Konstantin Burov
Sorry, I was wrong, HTC Legend is a MDPI device and i was expecting the HDPI images to load.I created an emulator with Nexus1 Config, and it picked up the images in HDPI folderAnd for 1.5 OS, I moved all the images from MDPI folder to Drawable folder.So now i have HD images in drawable-hdpi folderNo images in drawable-mdpi folderMoved all my images in drawable-mdpi folder to drawable folder.and added <supports-screens android:anyDensity="true" /> in my manifest file..Now my app looks good on all the Android phones i have tested on and picking up the correct images as i wanted.
Amith GC
A: 

You can try adding

android:targetSdkVersion="4"

and remove anydensity tag

Rahul
Tryed it now, and it did not work ..I have an image x.png in drawable-mdpi (red in color)and I have an image x.png in drawable-hdpi (blue in color)Expecting the blue color'd image to load in my HTC Legend (2.1) and Red Color'd image in Emulator (OS 1.5)
Amith GC
Then better create a folder called drawable in res dir and put your images related to 1.5 there. I think android should automatically use it accordingly.
Rahul