81412

Android screen density dpi vs ppi

According to the android documentation, density should be in <strong>dpi</strong> (dots per inch) and all layout measurement should be in <strong>dp</strong>.

and using a simple formula android can map <strong>dp</strong> to actual pixels.

px = dp * (dpi / 160), 160dpi ~ medium density screen which is the baseline

So why not just use <strong>ppi</strong> (pixels per inch) to describe screen density ?

Answer1:

There is a lot of documentation about this issue, but I think this part is relevant for your question:

Supporting Multiple Screens

Density independence

Your application achieves "density independence" when it preserves the physical size (from the user's point of view) of user interface elements when displayed on screens with different densities.

Maintaining density independence is important because, without it, a UI element (such as a button) appears physically larger on a low-density screen and smaller on a high-density screen. Such density-related size changes can cause problems in your application layout and usability. Figures 2 and 3 show the difference between an application when it does not provide density independence and when it does, respectively.

<img src=https://www.e-learn.cn/content/wangluowenzhang/"https://i.stack.imgur.com/Sy3i3.png" alt="enter image description here">

<img src=https://www.e-learn.cn/content/wangluowenzhang/"https://i.stack.imgur.com/UNnyf.png" alt="enter image description here">

Answer2:

From what I've read it is a design based distinction; the developers shouldn't worry about the individual screens they are deploying to, and should use dp within the application to make it as portable as possible across the different android devices.

For designers of assets the display size and sharpness of image are more important, and the dpi distinction is the one that matters to them.

For more information check out this article/e-book written by a google engineer:

http://sebastien-gabriel.com/designers-guide-to-dpi/

In particular check out the section "The PPI Configuration". Quote from the article:

<strong>Anything non-print uses pixel sizes regardless of the initial PPI configuration... PPI configuration in software is a printing legacy. If you design only for the web, PPI won't have any influence on the size of your bitmap.</strong>

Recommend

  • Drag Fabric.js object from one canvas to another
  • Execute command promt process asnyc and get result
  • openoffice: duplicating rows of a table in writer
  • Writing byte array to txt-file and reading it back
  • How to choose number of bins in numpy.histogram?
  • how to set android splash screen using config.xml of cordova2.6
  • How do I keep some element fixed on the screen in react-VR
  • Unix Shell scripting for copying files and creating directory
  • Creating a power-point file reader ( pptx ) [closed]
  • How to get scaled bitmap with respect to screen size with out getting Out of memory exception
  • printk - showing in message log but not in terminal for any kernel log level
  • Algorithm for placing nodes on a circle considering their distance to eachother
  • SQL Service Broker: Collecting data from distributed sources.
  • how to set image's top and bottom in same size for android?
  • Imagemagick set interline spacing?
  • Need help centering a div class on page
  • Linux over commit heuristic
  • How to know if a JFrame is on screen in a multi screen environment
  • Android onKey w/ virtual keyboard
  • MeeGo Handset Emulator not starting on Windows 7
  • Atlas images wrong size on iPad iOS 9
  • Extracting HTML between tags
  • Change multiple background-images with jQuery
  • Highlight one bar in a series in highcharts?
  • Repeat a vertical line on every page in Report Builder / SSRS
  • Bug in WPF DataGrid
  • How would I use PHP exceptions to define a redirect?
  • DirectX11 ClearRenderTargetViewback with transparent buffer?
  • How to extract text from Word files using C#?
  • Change an a tag attribute in JavaScript based on screen width
  • Cannot Parse HTML Data Using Android / JSOUP
  • How get height of the a view with gone visibility and height defined as wrap_content in xml?
  • Getting Messege Twice Using IMvxMessenger
  • need help with bizarre java.net.HttpURLConnection behavior
  • Authorize attributes not working in MVC 4
  • Busy indicator not showing up in wpf window [duplicate]
  • Python/Django TangoWithDjango Models and Databases
  • java string with new operator and a literal
  • Net Present Value in Excel for Grouped Recurring CF
  • How to load view controller without button in storyboard?