Jan 23

The New York Times had a great article yesterday about the outsourcing to China of all consumer electronics manufacturing in general and the specifically manufacturing of iPhones.

Woven into the article is the fascinating story of how the plastic screen of the first iPhone was replaced with the Gorilla Glass that we know and love, in just six weeks before the iPhone went on sale. No other company besides Apple would even consider pulling off such a feat. And there’s no other place in the world besides Shenzhen China where it would be possible.

written by Nick

Jun 23

My iPhone 4 just arrived. Here are my initial thoughts.

Retina Display

The first thing you notice as soon as you turn on the iPhone 4 is the new display. It is absolutely gorgeous. Not only is the resolution so much higher, but the pixels are also much closer to the glass, which combined creates a stunning effect. Sometimes when you walk into an electronics store they have dummy versions of some gadgets which have a sticker on the front panel to show you what it would look like if you could turn it on. The iPhone 4 display looks like that with the image right at the surface and with the same resolution as print.

Any text rendered in your app will automagically be rendered in the higher resolution on the iPhone 4. But any graphics will be scaled up. The graphics don’t look nearly as bad as the 2x mode on the iPad, but you definitely notice the difference in sharpness. For example compare the icons of the built-in Apple apps with the surrounding icons that have not yet been optimized for the new display.

Speaking of icons: Here’s a nice overview of all the different icon sizes that you should be creating for your apps to take full advantage of the screen resolution of each device. There are more sizes on this list than you think…


Having upgraded from an old iPhone 3G as my daily device, the speed of the iPhone 4 seems blazing. Everything is faster including installing apps and backups. It’s very easy to get spoiled. But keep in mind that a majority of your customers don’t have the iPhone 4. My main development and testing device is still a first generation iPod Touch. And I’m not done with my performance tuning until it runs fast on that device.

Fast Task Switching

The world has demanded “multitasking” on the iPhone, and Apple’s marketing department has delivered. In all seriousness, the engineers have implemented a really good mechanism for quickly switching between apps. However, as a user I still find it confusing. This is mostly because apps behave inconsistently when you launch/resume.

To participate in fast task switching you need to recompile your code using the 4.0 SDK. WIthout recompiling, your app will behave just like it does today under iOS 3.x and earlier: the app fully exits and launches from scratch each time. (Yes, I know that old apps still show up in the task bar when you double-click the Home button. But that’s because the task bar is a list of recently launched apps, most of which are no longer resident in memory, and even fewer are actually running.)

But you shouldn’t stop with a simple recompile. The important, and difficult, part is to maintain and restore the application state. If your app happens to be still in memory when it’s relaunched, then the state of the app will be just like the user left it. This is what the user expects. But if your app has been terminated, perhaps because the OS needed to reclaim the memory, then it will be launched from scratch. In this case it’s your responsibility to completely restore the state. The user has no idea of what the OS is doing behind the scenes, so the behavior of your app should not vary between these two situations.


written by Nick \\ tags:

Jun 17

In Session 147 – Advanced Performance Optimization at WWDC last week Apple put up a slide that listed the amount of memory in each iDevice. At the time there was an audible gasp from the audience followed by frenetic note taking. As far as I know this was the first time Apple has ever officially confirmed the amount of memory in these devices. Since all WWDC sessions are covered by a special NDA, I cannot reveal the contents of the slide. But if you go 1:55 into the WWDC video you can see it for yourself.

It has been widely reported that the iPhone 4 will have twice the memory of the iPad. This is curious since at the time the iPad was released with the new A4 SOC with the integrated memory in the chip, it was assumed there was a physical limitation to the amount of memory that could be put in the SOC. It is great to see that Apple has broken through that barrier.

Having the exact same chip in the iPhone 4 as the iPad would make sense to gain efficiencies from scale. And given Apple’s margins on their products I can’t imagine that bumping up the memory would be too much of a financial burden. So why not quietly upgrade the iPad processor with the iPhone 4 version that has double the memory? Isn’t this why Apple never advertises the amount of memory in their iDevices, so they have the flexibility to make changes at their convenience?

written by Nick

Apr 12

I’m happy that I was wrong in my prediction about the first round of apps crashing due to memory issues. At least for the most part.

Although it seems that many developers had their apps rejected because they did not work very well when tested on real device, compared to running in the simulator. I think a large portion of these issues can be attributed to memory, or lack thereof.

It is now confirmed that the iPad only has the same amount of memory as the iPhone 3GS: 256 MB. Why couldn’t Apple spend a few dollars extra on a $500 device to double the memory to 512 MB? I think one answer can be found in iFixit’s teardown of the A4 processor. The memory is actually built-in to the same package as the A4 CPU. This makes for blazing fast access to the memory by the CPU, which is important when moving around large blocks of memory quickly for displaying on the screen. Having the memory chips physically close to the CPU also reduces the power consumption significantly. But cramming in the memory chips into the CPU “chip” limits the amount of memory you can have. It’s not like you can just add a standard SIMM module with more memory.

All hardware design is an exercise in trade-offs. For the iPad Apple had to find the best trade-off between:

  • Memory capacity
  • Memory access speed
  • Battery life

In their infinite wisdom, Apple settled on 256 MB of RAM for the first iPads. And we developers have to learn how to live within those constraints.

written by Nick \\ tags: