my dog learned polymorphism*
The moose likes Android and the fly likes How can i create AVD for different sizes and densities? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "How can i create AVD for different sizes and densities?" Watch "How can i create AVD for different sizes and densities?" New topic
Author

How can i create AVD for different sizes and densities?

fahimeh hashemian
Ranch Hand

Joined: Aug 07, 2012
Posts: 84
I want to change the program that the program be multi screen. I want to create a few emulator for test my program. I want to create some emulator that check table3 in this link(http://developer.android.com/guide/practices/screens_support.html#testing) but i don't know how can i create a AVD for small screen with high density?

In create new AVD window in Eclipse, in opposite "Name", i write name of emulator and in opposite "Target" i select Android 4.1 and i write 128 for SD card size but i don't know how can i select size and density?

Thanks for advises.
Cheers.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

You will have to create a new device. On the AVD Manager, switch to the Device Definitions tab and press New Device (or start by selecting one of the devices which is close to what you want and pressing Clone). Then set it up with the following parameters:
* Screen Size: 2.7"
* Resolution: 480x640
* Size: Small
* Density: hdpi

Once you save the device you should be able to go to the Android Virtual Devices tab, create a new AVD and select the one you made in the Device: drop-down.

Note, I am using the latest SDK, options and names may differ in an older version.


Steve
fahimeh hashemian
Ranch Hand

Joined: Aug 07, 2012
Posts: 84
Steve Luke wrote:You will have to create a new device. On the AVD Manager, switch to the Device Definitions tab and press New Device (or start by selecting one of the devices which is close to what you want and pressing Clone). Then set it up with the following parameters:
* Screen Size: 2.7"
* Resolution: 480x640
* Size: Small
* Density: hdpi

Once you save the device you should be able to go to the Android Virtual Devices tab, create a new AVD and select the one you made in the Device: drop-down.

Note, I am using the latest SDK, options and names may differ in an older version.

Thanks for answer but i don't understand where is this parameters? I select Window in Eclipse, then select AVD manager and select New and I can select name, size and etc. Please more explain. Thanks.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

When you open the AVD Manager in eclipse (before you press New) there are two tabs. One of them says Android Virtual Devices, the other one says Device Definitions. Switch to the one that says Device Definitions. Then press New.
fahimeh hashemian
Ranch Hand

Joined: Aug 07, 2012
Posts: 84
When i select AVD manager in Window menu, i see picture1 and when i select New, i see picture2 and when i select Start, i see picture3. How can i fix size and density of a emulator?


I write resolution 480*640 in picture2 and i select "Scale display to real device" in picture3 and write 3 for screen size but when i run the program with this emulator, the program opens a emulator with big screen ! Why?



[Thumbnail for picture1.png]


[Thumbnail for picture2.png]


[picture3.png]

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41613
    
  55
Sorry but i don't know why my pictures not show!

You can't link to pictures on your local machine. You either need to upload the images to some server and then use the the URL that they have on there, or attach them to your post via the "Attachments" tab.


Ping & DNS - my free Android networking tools app
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Sorry, can't help you then. That looks much different than what I get using the latest SDK. Maybe there is another tool somewhere in the <Android SDK>\tools\ folder.

edit:
Actually, that looks like the New you have there is a combination of what I have. So in screen 2 you set the resolution. In screen 3 you set how big the screen is and the density of you display monitor. Chances are if you have the screen size set correctly to the size of the Android screen, that you have the wrong monitor DPI, so the screen gets spread out. If you don't know your actual screen DPI you can estimate it by taking the resolution and dividing it by the size. For example, my laptop is: 1366x768 pixels and 13.3". Since 13.3" is a diagonal, the number of pixels along that line = SQRT((1366)^2 + (768)^2). That comes to about 1567 pixels in diaganol / 13.3" in diagonal = about 117 DPI.
fahimeh hashemian
Ranch Hand

Joined: Aug 07, 2012
Posts: 84
Thanks for answer.
How can i find resolution of my laptop? 13.3 is inch or pixel? Screen of my laptop is 11 inch but i don't know how can i find resolution.

In opposite Monitor DPI in Eclipse write 96, Is it default or this is really true (is really Monitor DPI)?

Thank you.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

fahimeh hashemian wrote:Thanks for answer.
How can i find resolution of my laptop? 13.3 is inch or pixel? Screen of my laptop is 11 inch but i don't know how can i find resolution.

In opposite Monitor DPI in Eclipse write 96, Is it default or this is really true (is really Monitor DPI)?

Thank you.

If you are using Windows, right click on the desktop and choose "Screen Resolution". This gives you the number of pixels used by the display. To get the physical size (in my example 13.3 inches) - if you don't know it then use a ruler and measure in inches.

The 96 DPI is just a default value, Eclipse can't calculate that for you (which is why it asks).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can i create AVD for different sizes and densities?