0

i want to make avd for Moto E device specification but for moto e device has 256 ppi pixel density so when i create avd in new version there are no any option for make custom avd with custom ppi see below image.

enter image description here

Any idea how can i make Moto E device avd?

EDIT

In 480 x 800 resolution device

enter image description here

In 540 x 960 resolution device

enter image description here

in my dimen.xml i give value

  <dimen name="text_normal">10sp</dimen>

my row.xml is look like below

<LinearLayout
    android:id="@+id/itemLayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:background="@drawable/selectore_listview"
    android:orientation="horizontal" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="5dp" >

        <ImageView
            android:id="@+id/drawer_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_gravity="center_vertical"
            android:src="@drawable/drawer_properties" />

        <TextView
            android:id="@+id/drawer_itemName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="5dp"
            android:layout_toRightOf="@+id/drawer_icon"
            android:text="dfdsjgfhgdj"
            android:textSize="@dimen/text_big_normal" 
            android:textColor="@android:color/white"
              />

        <TextView
            android:id="@+id/counter"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/img_add_rbn"
            android:layout_alignTop="@+id/img_add_rbn"
            android:layout_centerVertical="true"
            android:layout_gravity="center_vertical"
            android:layout_toLeftOf="@+id/img_add_rbn"
            android:background="@drawable/rect_counter"
            android:gravity="center"
            android:text="00"
            android:textSize="@dimen/text_normal" 
            android:textColor="@android:color/white"
              />

        <ImageView
            android:id="@+id/img_add_rbn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_gravity="center_vertical"
            android:layout_marginRight="50dp"
            android:gravity="center"
            android:src="@drawable/drawer_rbn_addnew"
            android:textSize="12sp" />
    </RelativeLayout>
</LinearLayout>

and i set this value in counter value of manage property which is gray in my image so you can see difference in 480x800 screen it look nice but in 540x960 it comes very small so any idea how can i solve it?.

Harshal Kalavadiya
  • 2,412
  • 4
  • 38
  • 71

2 Answers2

1

There is no option for ppi because android devices are scaled in density(dpi).

Instead what you need to do is to find a dpi for your device which has 256ppi,540x960, and 4.3 in size.

Here is the sample of it taken from wiki

11 (4.3)    540x960 101 (256)   1.5 hdpi

That device is using hdpi as density which is equivalent to 256ppi that you are trying to find.

Rod_Algonquin
  • 26,074
  • 6
  • 52
  • 63
  • 1
    :: ya but i wnat ot maintain my layout in 480x800 as well as 540x960 device resolution so i make emulator with 540x960 resolution with 240 dpi but when i run my app in actual Moto E device than at that time all textsize value getting very small.. – Harshal Kalavadiya Aug 02 '14 at 05:34
  • @HarshalKalavadiya " i wnat ot maintain my layout in 480x800 as well as 540x960 " it will automatically resize the layout for you instead if you have images, for textsize you need to use your values folder for different value of the size of your device. – Rod_Algonquin Aug 02 '14 at 05:39
  • @ Rod_Algonquin :i already make folder for that like value-hdpi,value-mdpi,values-xhdpi but in 540x960 resolution device take textsize value from values-hdpi which is compatible for 480x800 so when i run my application in 540x960 resolution device it getting small .. – Harshal Kalavadiya Aug 02 '14 at 05:46
  • @HarshalKalavadiya can you post an image of textview of 480x800 and 540x960 – Rod_Algonquin Aug 02 '14 at 05:55
  • @HarshalKalavadiya is the setting for 480x800 of avd is hdpi?? – Rod_Algonquin Aug 02 '14 at 05:56
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/58537/discussion-between-harshal-kalavadiya-and-rod-algonquin). – Harshal Kalavadiya Aug 02 '14 at 07:06
  • @ Rod_Algonquin:: see my answer but i also mark you answer +1 because it is also give some hint to me. – Harshal Kalavadiya Aug 04 '14 at 05:17
0

I found solution for 540 x 960 resolution device value.xml . i make folder file for 540x960 resolution device as values-sw360dp and inside it i make dimens.xml file for that and it is working for me.

by using below formula i create value folder for 540 x 960 device

px=540 width of device

dp=240 density of device

dp=(px/dp)*160
  =(540/240)*160
  =360

so finally create values folder like values-360dp for 540x960 device. And you can create other folder fo rmaking combination of screen width and density of device and make UI interface good for that.

for 480x800 devcie

res/values-hdpi/dimens.xml

for 540x960 device

res/values-sw360dp/dimens.xml
Harshal Kalavadiya
  • 2,412
  • 4
  • 38
  • 71