1390

iPhone Screen Resolution. 160 vs 163 vs. the future

Question:

I'm trying to make an app that displays something in real-world units. It's not a ruler app, but it wants that kind of precision.

It already looks like the iPhone and iPod touch have different screen resolutions (160 & 163 respectively)

I've found this <a href="https://stackoverflow.com/questions/610193/calculating-pixel-size-on-an-iphone" rel="nofollow">Calculating pixel size on an iPhone</a> and this <a href="https://stackoverflow.com/questions/1255708/iphone-screen-resolution-changes-in-future-hardware" rel="nofollow">iPhone screen resolution changes in future hardware</a> and this <a href="http://forums.macrumors.com/showthread.php?t=350612" rel="nofollow">http://forums.macrumors.com/showthread.php?t=350612</a>

From my reading it sounds like I can treat the 320 * 480 screen space as 2 * 3.5 inches, ignoring the difference between the iPod and the iPhone resolution, which only seems to affect the clarity of the image, not the size.

My question(s) are: is this true? any way to determine this (320 "pixels" == 2 inches) in code, so if it changes I don't have to update.

Answer1:

I wouldn't worry about it for now, if Apple changed it and didn't tell their developers then they would lose customers themselves. Just hard code your app to work in this environment for now.

The PPI shouldn't be different, but all other apps run fine and the only hardware differences Apple tells us to account for are microphone, camera, Internet connection, and phone-ness. (Even if the PPI is different, it's still 320X480 pixels no matter how many inches are used.)

Answer2:

Reference the question which claims:

<blockquote>

320 * 480 screen space as 2 * 3.5 inches

</blockquote>

That claim is wrong. The screen size is a 2:3 ratio. The <strong>diagonal</strong> is 3.5 inches.

Using a 3.5 inch diagonal and using the 2:3 ratio, a calculation gives approximate screen dimensions of 1.94 * 2.91 inches.

It really is 320 * 480. It just is not 2 inches by 3.5 inches, nor even 2 inches by 3 inches. The display is a just a bit smaller than 2 inches by 3 inches. That is why it can be 320 * 480 and not be 160 ppi. (Or be 640 x 960 and not be 320 ppi with the iPhone 4).

Answer3:

If you look how you <a href="http://en.wikipedia.org/wiki/Pixels_per_inch" rel="nofollow">calculate ppi</a>, you need to know the advertised screen size in inches. I believe you are safe to deal with [[UIScreen mainScreen] bounds] as JoePasq said. You can set a const of what you think an inch is for yourself and use the width and height of the bounds to represent your measurement. This will allow you app to scale if they ever do change the size of the screen.

Recommend

  • Emulate low resolution device on the chrome dev tool
  • Why does Android's Nexus 7 virtual device not load my “large” layout resources?
  • Update to Xcode 5.1 and layout for 4 inches does not works fine
  • Javascript: adding an integer and decimal giving wrong answer
  • Capture literal brackets inside brackets in pyparsing
  • Recursion in F# | What's happening?
  • Ignoring a field without modifying the POJO class with Jackson
  • Shift operation implementation in java
  • How would you model data variables variance on common scheme? SQL
  • AWS SES Production Access setup with Meteor
  • Wierd Results using script to find length of a string?
  • Concise R data.table syntax for modal value (most frequent) by group
  • Insert Pandas dataframe into Cassandra Table
  • How to not need user input for install.packages(type = “both”)
  • FTPWebRequest .NET 3.5 vs 4
  • How Does Navigation in xamarin.forms Works?
  • how to display   in Mozilla using XSL.
  • How can I see a list of all files that are different between two Hg repositories?
  • What does the TypeScript “lib” option really do?
  • Receive mouse move even cursor is outside control
  • Javascript/Jquery runs fast in desktop browsers, but slow in mobile/smartphone browsers…should I spl
  • Request response issues in biztalk
  • Overlapping controls in Windows XP
  • Java color detection
  • Differences in dis-assembled C code of GCC and Borland?
  • How can I enlarge video fullscreen without the affected interface project in as3?
  • zope_i18n_compile_mo_files doesn't work on a Zeo configuration
  • OOP Javascript - Is “get property” method necessary?
  • Installed module is empty
  • Python urlparse: small issue
  • Reading JSON from a file using C++ REST SDK (Casablanca)
  • Scrapy recursive link crawler
  • FileReader+canvas image loading problem
  • Upload files with Ajax and Jquery
  • Do I've to free mysql result after storing it?
  • How to disable jQuery.jplayer autoplay?
  • A cron job substitute?
  • json Serialization in asp
  • What are the advantages and disadvantages of reading an entire file into a single String as opposed
  • python draw pie shapes with colour filled