views:

141

answers:

2

Hey. all, I'm in the process of up-scaling the graphics for my game for better display on higher density devices. I created the higher dpi artwork, added it to the correct place (res/layout/drawable-hdpi). I added the following to my manifest:

 <supports-screens 
      android:smallScreens="false"
      android:normalScreens="true"
      android:largeScreens="true"
      android:anyDensity="true" />

And it worked beautifully... with the exception of one image I forgot to upscale and was being pulled from drawable-mdpi. I upscaled that image, dropped it into drawable-hdpi and relaunched. Now the game is only pulling images from mdpi.

I can verify with git that the only change i made to the codebase since it was working is adding the new image file. For troubleshooting purposes I've tried both removing that added image and resetting my git repo to the state it was in when it worked. In both cases its still just always loading from mdpi. This leads me to believe it may be an issue with the emulator. I'm developing this in my car on a netbook, which sometimes gives me issues with the emulator (usually takes an hour or so to boot and runs very, very sluggishly on the Atom).

Anyone have an idea as to what might be stopping the game from pulling from hdpi?

Edit

After a lot of troubleshooting I'm still no closer to solving this. It seems my app may be running in compatibility mode. It's not displaying "postage stamp" sized, it's using the whole wvga800 screen; but getDisplayMetrics().density returns 1.0. The emulator states it is set at High (240) dpi, so I'm assuming density should be > 1.0.

Random datapoint: Changing the drawable-hdpi directory to drawable-large causes the larger images to load. In that case getDisplayMetrics().density is still 1.0 so I can't do proper px->dp conversions.

+2  A: 

Check out my problem here

http://stackoverflow.com/questions/3305941/android-eclipse-emulator-problem-runs-wvgahdpi-as-a-mdpi-screen

The way I fix it is to delete the AVD and create a new one. I'm still trying to find an concrete answer to the problem. So far all you can do is restart the computer and/or make a new AVD.

Cameron
thanks for the info. I'm not sure my problem is related as it seems my avds are running the home screen at the proper density. I'm going to investigate a bit and create some new avds / reboot. Ill let you know if things seem related to your issues.
Electronic Zebra
Just an update, deleting / recreating the AVD didn't help. Think my issue is something different.
Electronic Zebra
+3  A: 

res/layout/drawable-hdpi is not the correct location. res/drawable-hdpi is the correct location.

Moncader