Questions tagged [pixel-density]

Pixel density, or resolution, is the measurement of pixels per inch/centimeter of devices such as computer displays, smartphones, scanners, or image sensors.

Pixel density is the number of pixels a display can fit into a fixed distance. This measurement is calculated in pixels per inch (PPI) or pixels per centimeter (PPCM). The higher the pixel density, the crisper the output of the display appears. The human eye can not discern granular detail when it is higher than 300 PPI.

Common Pixel Densities

  • 72/96 PPI - Common for standard definition web graphics
  • 150 PPI - Offset Print Quality
  • 220+ PPI - Retina Displays
  • 300 PPI - Large Scale Print Quality
  • 557 PPI - Samsung Galaxy S6
64 questions
0
votes
1 answer

Android: PDF created using PrintedPdfDocument looks different on different devices

I am trying to render a view to a PrintedPdfDocument. The size of the page, as expected, is in units 1/72nd of an inch. So, for an A0 size page (width = 33.11 in), document.getPageWidth() returns 2384 (33.11 * 72). The page canvas width equates one…
0
votes
5 answers

Android: Handling text size for different dip devices

I am getting different text size for same screen size, different dpi devices. I want the text to be the exact same size on all devices (like Inshorts app). As can be seen in these screenshots text size of xxhdpi is slightly bigger than 560 dpi…
Sid
  • 11
  • 3
0
votes
1 answer

Standardized image sizes on android

So I'm trying to build a basic app on Android Studio 1.4.0. Yes, I know it's old, but being pretty new to app-building and having found a tutorial I thought I'd go with it. My question: I put an image into "@drawable." How do I make sure it…
user10039596
0
votes
1 answer

Different density support

I have created the following .xml layout in my project in an effort to create a scalable layout that supports both different screen sizes and densities:
0
votes
0 answers

How to detect and distinguish device pixel density and zoom in Chrome?

How can I detect (in JS in Chrome) the zoom level AND device pixel density (separately), to be able to scale graphics to the level of 1 device px = 1 screen px (to avoid blur) but still allow users to use the browser zoom feature?
jaboja
  • 2,178
  • 1
  • 21
  • 35
0
votes
0 answers

Same dimensions across different pixel densities

I am developing a Cordova app and I have this problem: I wrote all the css with px measures, now I see that in lower density devices everything appear a lot bigger. I want everything to be the same dimensions on every device (even at the cost of…
0
votes
1 answer

Android: How to account for pixel density

I am really struggling with trying to handle the pixel density of screens. How do I make my application look the same on all devices? I thought the answer might be changing the units from dp to px: public static int dpToPx(int dp) { return…
Ryan
  • 727
  • 2
  • 14
  • 31
0
votes
0 answers

How find out a device's size and screen density specifier non-programatically

I want to know how to find out the correct combination of a device's size specifier (large, xlarge, xxlarge, etc) and screen pixel density specifier (hdpi, xhdpi, xxhdpi, etc). Please explain the method using Oppo F3 as example because I defined…
iammrmehul
  • 730
  • 1
  • 14
  • 35
0
votes
1 answer

Android Studio Density

I change from Eclipse to Android Studio. I'm facing a problem with the densities of the Emulators. For example, in Eclipse the Samsung S4 was density xxhdpi but in Android Studio is xhdpi. Samsung S4: 4,99' - 1080 x 1920. This is my code: Float…
user3240604
  • 407
  • 1
  • 8
  • 22
0
votes
1 answer

Does `wrap_content` works the same way as Density Pixels?

I have read Android guidelines regarding different screen sizes, but still I have some considerations. Client has given me an image from PSD file which has certain resolution that fits 1080 X 1920. I just use wrap_content, and it perfectly fits the…
Taha Kirmani
  • 1,274
  • 6
  • 26
  • 55
0
votes
1 answer

How to scale bitmaps to take the same percent of the screen with different screensizes and densities?

I am trying to scale bitmaps on a canvas in Android. What I currently am doing: int scaleFactor = 0.01; int size = screenWidth * screenHeight * scaleFactor; Rect rect = new Rect(x,y, x + size, y + size); canvas.drawBitmap(bitmap, null, rect,…
Gaute-MO
  • 36
  • 7
0
votes
1 answer

What does HeightPixels / Density actually represent?

I am looking at setting the FontSize of my application based on how big my device is. i.e. If the device is below 8" make the font smaller than the default. So the device I am using is a Lenovo S8-50 8-Inch Tablet and as you can see in the…
JKennedy
  • 18,150
  • 17
  • 114
  • 198
0
votes
1 answer

How should you (not) use density independent pixels on Android?

One poster suggested using a project called SDP, as an answer to a question regarding the Android density independence mechanism. He justified it, saying: It can help Android developers with supporting multiple screens Why is that a bad answer or…
arekolek
  • 9,128
  • 3
  • 58
  • 79
0
votes
1 answer

Setting density pixels programatically in Android not functioning correctly

I have a list view which displays news items. Each news item may / may not contain an image. If it does contain an image, cool! If it doesn't contain an image I set the image placeholder to invisible, and resize the frame layout it is contained…
Greg Peckory
  • 7,700
  • 21
  • 67
  • 114
0
votes
2 answers

Android application using lowest density drawable

I created res drawable directories for different densities, but application always use lowest density. I created drawable-mdpi, drawable-hdpi, drawable-xhdpi and drawable-xxhdpi but in my phone with xxhdpi app using mdpi, if i delete mdpi then app…