DIP is short for Density Independent Pixel. It is used by the Android system as a unit of measurement to make GUIs fit on different screen sizes with scaling. This allows the developer to create a single interface for different screen sizes.
Questions tagged [density-independent-pixel]
119 questions
0
votes
1 answer
Chrome on Android pixel ratio off?
I've implemented em's throughout all my mobile CSS, and I just set the font-size once on the body tag based on device-pixel-ratio to either 16px (ratio: 1), 24px (ratio: 1.5), or 32px (ratio: 2) etc., but when I open my site in Chrome on Android, it…

bearfriend
- 10,322
- 3
- 22
- 28
0
votes
1 answer
calculating nine patch sizes for all densities
I dont know how is best way to calculate size in pixels for round corners in nine patch images in all folders (hdpi, mdpi...), if I want for example 5dp round corner or something close to this size on all devices

honza3486432
- 3
- 1
0
votes
1 answer
How to measure the physical distance between two points on a screen (Android)?
I'm building an Android app where the user has to touch a circle on the screen, and I need to record how far away the user's touch was from the center of the circle.
Thing is, I want to record the physical distance, not the pixel distance, because…

XåpplI'-I0llwlg'I -
- 21,649
- 28
- 102
- 151
0
votes
1 answer
How to make the button fit the same amount of the screen and be in the same place on android app
I have a basic soundboard app that I am developing for android using eclipse, which has 8 buttons. When I view these on the default 3.7" nexus they are all perfect size and positioning, but when I go use another screen a 4.7" for example the buttons…

RexRApps
- 21
- 2
0
votes
0 answers
Android: device independent pixel
I know using dip is good for compatibility to different screen devices. But I would like to ask i a tablet of 600*800 as an example with a text field of 600 dip fit to the screen. Does it still fit on on a 400*320 screen as well.

LittleFunny
- 8,155
- 15
- 87
- 198
0
votes
1 answer
Android: device independent pixel?
If i have 96dip on a smaller screen device, it will enlarge to keep the ratio to the large screen device.
Am I right?

LittleFunny
- 8,155
- 15
- 87
- 198
0
votes
1 answer
Android views not scaling on different sized devices
I am using eclipse I have views with images and buttons with their width and height set in dp:
-1
votes
1 answer
can't find dimens.xml file. how to create one?
I want to have a dimens.xml file, where I keep dimensions that I use in my Android Studio main_activity.xml file, but I can't find it in app->res->values.
Are we supposed to create that file on our own? If yes, how to do it?
I tried to search for…

Maksym
- 9
- 1
- 3
-1
votes
2 answers
android convert dip to pixels?
my issue is i want to re-size all images inside the post by showing 2 images per row
my app send the width of screen to the php api the php api must convert the dip to pixels and set image width 50% of screen dip
this is what aim doing so…

Kodr.F
- 13,932
- 13
- 46
- 91
-1
votes
1 answer
How to create a banner for android app which can fits all different kinds of screen?
I'm going to create a banner at the top of screen. But I don't know how to fits all different kinds of screen.

Bagusflyer
- 12,675
- 21
- 96
- 179
-2
votes
1 answer
How to call image variable to another call in c#
I have two class Mainwindow and Mini_Screen which derive from Window class.i want to access image variable to another class and how video stream.here is the code
public partial class MainWindow : Window
{
public static Image…

user3682298
- 1
- 1
-2
votes
2 answers
How to set BMP file width and height in DIB header when image size exceeds 255 pixels?
I am creating simple BMP image with Java. Unfortunately I do not know how to store width and height size information into the DIB header, when the size of width or height exceeds 255 value in decimals (FF value in hex). To create small size image…

Fataho
- 99
- 3
- 15
-4
votes
1 answer
Conversion between px and dp unit
I want to set layout_marginTop to 800px using setLayoutParams(). But I want know what would be this value in dp unit?
Thanks in advance.

Zerntrino
- 67
- 1
- 8
-7
votes
1 answer
Android layout does not fit in screen
I have a layout that fits all of the phones but when the resolution is 480x800 the bottom of the layout is off the screen. I am using dpsizes. Should not it be density independent regardless of the pixel count. What should I do to solve this issue?

orkun
- 385
- 1
- 3
- 12