Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make an emulator for specific device resolution(HTC Cha-Cha)?

EDIT

Everyone can try to make an emulator for this phone http://www.gsmarena.com/htc_chacha-3787.php to see what I mean. The icons will be huge and the screen you get is not the same as on the real phone.

Here are the specs:
Display: TFT capacitive touchscreen, 256K colors
Size: 480 x 320 pixels, 2.6 inches (~222 ppi pixel density)


I tried to make an emulator for a specific Android phone, but the resolution was all wrong. So I will write what I did, and I hope someone will correct me.

First I go to GSMArena.com and pick some phone (I'll use a random here)

Sony Ericsson Xperia PLAY

I see that the size of the screen is 480x854 with a density of 245 ppi.

Then I create a new emulator machine with WVGA854 (LARGE type of screen) and I manually set the DPI to 245 (HDPI).

Is this correct: 245ppi == 245dpi?

Sometimes this works, but most times, I get big icons on a small screen, especially when I try to make an emulator for NORMAL screen phones which have resolution of around 240ppi. When I compare such screen on the emulator with the original phone screen snapshots, I see it's just not the same.

So what is the best way, to create an emulator, for a specific mobile phone, so that it exactly match the manufacturer's screen size and pixel density?

like image 519
sandalone Avatar asked Mar 17 '12 10:03

sandalone


1 Answers

Go to Eclipse

Window - Android SDK and AVD Manager - New 

in Skin select Resolution and give 480 X 854

and in Hardware click on New select "Abstract LCD Density" and change it's value to Density you get from below formula (if its given in ppi in the device specification) or keep it as it is if given in LCD density.

and then start that AVD.

EDIT

Yes you are right and I search a bit more and found Formula to Convert PPI to Abstact LCD Density here in this answer.

sqrt(xx + yy)/d

where x and y are the horizontal and vertical resolution (so that sqrt(xx + yy) is the length of the diagonal in pixels), and d is the length of the diagonal in inches.

Hope this ends your search now.

like image 74
MKJParekh Avatar answered Sep 28 '22 03:09

MKJParekh