I’ve gotten three of the OnScreen Science, Inc. iPhone apps reworked for iOS 4 and the new iPhone 4. Two of them—OnScreen Pitch Count 1.5 and OnScreen GPA Pro 1.2—have been approved and are now on sale. OnScreen DNA Lite for iPhone 1.1 is still in the queue for review. If things proceed as for the other two (week of waiting, a few hours in review), then the update of the third app should be on sale August 12 or 13. The update of the fourth app, OnScreen QB Stats, involved more than just making it work and look good under the new system and on the high-definition “Retina” screen of the new iPhone. I wanted to give it the same improved user interface and navigation among games and players that OnScreen Pitch Count had recently received, so it is taking a little longer. Given that football season is still a ways off, OnScreen QB Stats was a lower priority. Assuming the rest of testing and debugging is not prolonged, that update should be on sale by around August 20.
One of the nifty new features of iOS 4 on later generation iPhones and iPod Touches is multitasking. Whether or not it’s “true multitasking,” Apple’s implementation of the feature allows for keeping an app in memory when a new app is chosen to run on the same device, and then later to quickly switch back to the original app without having to load it again. Since the OnScreen Science apps had been programmed to remember where they had been whenever the user jumped to another app, so that they could resume right where they left off upon relaunch, the only difference with multitasking will be in the speed of resumption, but a second or two is a second or two.
The other essential part of updating for the latest iPhone is to make sure the screen displays of the app look good on the Retina screen. That means a developer has to produce and include higher resolution versions of any images and icons that the app displays. New screen shots for the iTunes App Store display of the app also have to be submitted. These were straightforward but somewhat tedious tasks. There weren’t many such images, so I had it easy compared to some people.
The one app I was worried about providing a nice iPhone 4 version for was OnScreen DNA Lite for iPhone. The virtual DNA model is drawn in 3D using the iOS implementation of OpenGL ES. The drawing assumes a certain pixel density, which is way off for the Retina display of the iPhone 4 which has a higher pixel density. Images drawn with the unmodified OpenGL code are displayed on the Retina screen just by blowing them up, so that they actually look worse—much more jagged—than they did on the old iPhone. It took me a while to figure it out, but the solution was very simple. I only needed to put in a test for what device the app was running on, and in case it was iPhone 4 make a change to one line of the old code (doubling the dimensions of glViewport for the iPhone 4) and add a call to scale the image by a factor of 2. I couldn’t believe my luck when I tried just that and saw it was all my code needed. Not only does the iPhone 4 version look better than the old version did on the iPhone 4, it looks better than the old version did on the old iPhone, since it takes advantage of the higher definition screen (extra pixels) during the image rendering. This can be seen in the comparison below.
Above is a screen shot from the original iPhone running OnScreen DNA Lite for iPhone.
Above is a screen shot from an iPhone 4 running OnScreen DNA Lite for iPhone.
There was another update to OnScreen Pitch Count before the latest version 1.5. A user had encountered the problem of not being able to view the pitching stats for the last couple of pitchers when he’d kept track of pitches for numerous pitchers on both teams. This turned out to be a bug I’d introduced in version 1.4 when I failed to take into account a change in view dimensions made necessary by the addtion of a toolbar at the top of the screen. The user called me to point out the bug, and I was grateful for that. I had a fix submitted in a day or two. I had already been working on the iOS 4 upgrade, but felt I needed to get the bug fix online as soon as possible without waiting for completion of the other changes, which is why 1.5 followed 1.4.1 so closely.