Android scaling – quick example

by: Jason

This morning I wanted to demo how android sizes text for our designer. So I wrote a quick app that displayed text sizes in a few ranges 10-20 sp , dp, and pt. A nice side effect was it also showed how well android handles the vast differences in screen sizes and densities out there.

Some quick photos showing how android handles displaying things at a particular size across screens of different densities. Here’s a galaxy nexus with a 1280×720 (~316 ppi) xhdpi screen and a galaxy s+ with a 800×480 (~233 ppi) hdpi screen both displaying the same app.

The text blocks are all 48dp high, also the suggested sweet-spot for hitbox heights. They are demoing different text sizes that one might set in both sp and dp measurements. (sp will grow if someone turns on large text in the system settings, dp won’t). These screens are very different in terms of pixel counts and physical sizes, yet android performs very well in making them almost physically identical to my eyes and fingers. The nexus screen does look better of course.

The later images shows the difference in using px or dp dimensions for a views width. There’s a noticeable difference setting a px width between devices. Hopefully few people are laying out stuff with px anyway. The docs and the tools point it out straight away as a ‘don’t do that’ moment.

However dp performs nicely and just like the heights, the blocks with a dp width are pretty much physically identical on both.

Android does get a bit of a bashing about the diversity of devices that exist, but the sdk does a very good job in trying to help the developer out as much as possible.

You May Also Like

App Store Optimization: Scaling Medical Apps

App Store Optimization: Scaling Medical Apps

Medical apps can be useful tools for helping users manage their health, appointments and medicine. Medical app developers have many things to take into consideration when launching their app, including: how will users find it? You can’t help anyone if your app isn’t...

read more
5 Sketch Plugins for UI/UX Designers

5 Sketch Plugins for UI/UX Designers

The best plugins are not only reliable but complement your workflow and enhance your designs. Here’s a quick list of some of our favourites that are useful not only for app designers, but anyone using Sketch as their main design tool.  Sketch Measure HTML Output from...

read more
Smartphone Trends Ireland 2020

Smartphone Trends Ireland 2020

19 out of 20 Irish adults own a smartphone. While ownership rates may be approaching a ceiling, the smartphone economy is just getting started and the smartphone industry is brimming with potential.Richard Howard, Partner, Technology, Media and Telecommunications,...

read more

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *