2

I think the phone uses the layout-hdpi file but this doesn't seem right, mostly because its dimensions(540 x 960) are not what I'm used to seeing(480 x 800) for layout-hdpi phones. So what is the actually layout file used? Also, if it is layout-hdpi phone how can I stretch an icon that has a width of 480 to 540? Would I programmatically have to test the phone's dimensions and then expand the drawable-hdpi file to fit the various device dimensions? I looked at this link but they never specified what layout file was used.

Community
  • 1
  • 1
thomas.cloud
  • 881
  • 13
  • 30

1 Answers1

2

Yes, HTC Evo 3d use drawable-hdpi images. You should have to put the Layout file also. Put the same file into layout-hdpi.

Now create the Emulator of the Resolution 540 X 960. And test the App in it. There should be minor difference between normal hdpi and HTC Evo Screen resolution. Manualy test it.

I am getting same trouble before some days. What i have done is: I am going to check the resolution of the devide screen size at run time. And if the Resolution is compare to that HTC Evo 3d then it will set the height and Width of the All Images at run time that fit to the HTC Screen Resolution.

That was the Best Solution i found till today to Make app for HTC Evo 3d.

For Checking the Resolution at run-time you can use this:

Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics dm = new DisplayMetrics();
display.getMetrics(dm);

int width = display.getWidth();
int height = display.getHeight();
if((height==960) && (width == 540)){
         // Do change the Image Height or Width  or position
}

Enjoy. :)

Shreyash Mahajan
  • 23,386
  • 35
  • 116
  • 188