dip

What is the correct way to specify dimensions in DIP from Java code ?

I found that it is possible to set dimensions of my interface elements in XML layouts using DIPs as in following fragment : "android:layout_width="10dip" But all Java interface takes integer as arguments and there is no way to specify dimensions in DIPs. What is the correct way to calculate this? I figured that I have to use property...

android Imageview layoutparams in dip ?

Hi, I'm using the following code : ImageView i = new ImageView(mContext); i.setImageResource(mImageIds[position]); i.setScaleType(ImageView.ScaleType.FIT_XY); //pixels settings !!! i.setLayoutParams(new Gallery.LayoutParams(200, 100)); but as you can see, it is setting the layout dimensions in pixels. Does...

dip notation not working - Android

Okay, from what I understand if I say <EditText android:layout_width="120dip" /> (With ID, height and all that good stuff added), it's supposed to create a text field that occupies 3/4th of the screen independent of the resolution of the screen. So why do I get a tiny little text box, with a width of not more than 20 real pixels on an A...

Android Image/DIP Questions

I am making a tile based game for Android. For the sake of argument, let's say I want to have 6 tiles across the top of the screen and that I want the tiles to fill the screen regardless of the phone I am using. The way I understand it, I want to be using Density Independent Pixels in my code to make sure that the images look the same ...