Hacker News new | ask | show | jobs
by robomartin 5182 days ago
I have a feeling that Apple might just start to run into the kinds of realities MS and others have been living with for years. Either they choose to piss off millions of users of older devices or figure out how to allow for evolution without causing problems for the installed base. Or, maybe they don't.

As an iDevice user I am glad that I chose to buy all my devices with the absolute max storage available. Everything I have has 64GB. So, we are good for a little bit.

As a developer I cringe at the situation. I am currently working on an app that has about 400 graphics files that will ship with the app. If you do it their way you have to produce each one of these files in four different resolutions. This means that the image directory is now huge. It is three times larger than a scenario where we would have app bundles customized for each device.

In looking at the problem we decided to do the following. All of our files are produced at what would be @2X resolution but are named without the @2X. We are going to ship the app with just 400 files at a single resolution instead of 1600 files at four different resolutions. In the end, if you do the math, your app bundle will be significantly smaller due to the significant reduction in size of the images directory.

As far as performance is concerned, the images work very well all they way back to iPod touch v2.0 devices. No issues there. So, that's the plan.

Maybe what Apple is pushing all of us towards is a scenario where we are forced to detect device type and capabilities and load resources accordingly on app first run. Think about this for a moment. Now their servers don't have to push out so much content and you will have to foot the bill for your free graphics-intensive app getting three million downloads. I could be off base here. But, I just don't see a way to deal with this unless you are willing to ship your app with thousands of files, most of which will never be used by the device the app is installed on.

I also think it's high time that apple put out an iDevice with the ability to expand memory capacity in the field. I know, I know, they want to control it all. They are big enough to have custom Flash chips made with all the encryption they want so people can't move the flash chips from phone to phone and steal software.

Happy coding.

7 comments

> I have a feeling that Apple might just start to run into the kinds of realities MS and others have been living with for years.

Why would they run into these realities now? Apple's been around just as long as Microsoft, and they have been pissing off their customer base with poor backwards compatibility the whole time. The scale is much larger now, I'll give you that, but the relentless forward-thinking is what has allowed Apple to get into the dominant position they are in now. Microsoft by contrast, got bogged down with the enterprise where large IT departments put them between a rock and a hard place by refusing to upgrade if they didn't support whatever byzantine legacy application infrastructure they were running. Even to this day where Microsoft realizes they need innovation, they are still forced to hedge their bets with this hybrid Windows 8 Metro crap.

Mark my words, this problem of app size is a tempest in a teapot. Given current trends, most iPads will be 3rd gen within a year, and in a couple years, the first iPad will fall off the iOS upgrade cycle. For every customer that Apple loses because they demand backward compatibility, they'll gain ten with the latest new shiny.

The reason Apple will not do anything this problem is not out of planned obsolescence or greed. All else being equal they would be happy for you to have unlimited space on your iPad. But to solve it is non-trivial and does not push their product forward. To the contrary, it adds complexity that will inevitably slow their product development, which runs directly contrary to their modus operandi.

Of course, I agree with what you are saying.

What I am saying is that these issues will become more and more pressing now that they are operating at a much larger scale than in prior years. In the past they could piss-off their cult followers and move on. I am not sure this is the case today. I think it might be reasonable to assume that normal folks --the bulk of the people buying iDevices--, not tech guys or cult members, will not take kindly to their 16 GB iPhone becoming obsolete simply because Apple released an iPad with more resolution. They would feel that this is absurd, and rightly so. There's nothing whatsoever wrong with older devices. Techies are different. I buy crap I don't really need just 'cause it's cool and sometimes because I want to actively support the company doing the cool stuff. Normal folk are far more practical than that.

If a normal person has a lesser-storage iPhone and, overnight, half their apps go away because they wont fit, they will not run out and buy a new phone. They'll be pissed. This will be particularly true if some mainstream media outlet grabs ahold of the reasons that led to this and outs the story to the general public.

There's another angle to this as well: Trash. Now Apple is in a position to generate, quite literally, mountains of trash based on decisions to not support older devices. I am not an environmental extremist by any measure, but I certainly don't like the idea of millions of perfectly good devices ending-up in the trash bin due to a bad tech decision.

> ... will not take kindly to their 16 GB iPhone becoming obsolete simply because Apple released an iPad with more resolution.

The vast majority of normals will never even realize this is the case. Plus, even if they do, people are well conditioned to the obsolescence of technology. I mean more people buy a new PC before they re-install Windows when things get unbearably slow, and if we had a graph of how often people upgrade their phones, I don't think we'd see much to support your point.

Now if the media decides to latch onto this (which I wouldn't doubt given the fervor for a juice Apple scandal), then it might piss off a few people, but do you really think that people will be convinced to trade in their iPads for pitchforks over this? What percentage of people are really not going to be able to update their apps anyway? If this really became a media problem then Apple might move to address it, but I stand by my written and attributed assertion that this is a non-issue for Apple and will not affect their bottom line or move them to any action other than to perhaps go 32/64/128 for the next iPad.

This comment is brilliantly introspective into the culture of Apple and in the benefits of leaving behind obsolescence.
"But to solve it is non-trivial"

No, it's trivial. Device-dependent DRM-signed packages. Either the common part is duplicated in each device's version, or app store downloads can consist of two packages.

Actually no it's not. Right now you have one package for an app, done. If you have multiple packages you have to think about getting the right one to the right device, so Mac => iOS syncing becomes more complicated. And that's just off the top of my head.

You are committing the common developer error of underestimating complexity. But when you get in there, I assure you, having one package per app is dramatically simpler.

"detect device type and capabilities and load resources accordingly on app first run."

That is not sufficient. You also would have to detect the case where a backup is restored to a device with a different resolution (could even be a lower resolution)

"you will have to foot the bill for your free graphics-intensive app getting three million downloads."

Not necessarily. The App Store could have provisions for doing these kinds of downloads. Because of the backup issue, I even think it would have to have support there, given that Apple would want to prevent the cases "sorry, cheapGames.com's server is awfully slow" or "sorry, junkSite.com's server has disappeared; we cannot get you the graphics for that game you bought anymore" (site names made up; if they exist in real life, the name match is coincidental)

Can't you do some sort of custom image compression? Bundle app with the highest resolution images, then scale them down, arithmetically subtract from the respective image and pack and ship the difference. Just gzip or paq it, and see what the savings are like. If it works (and my gut feeling is that it would), then reconstruct lo-res images on the fly when they are needed.
Automatic scaling doesn't work very well. You can find numerous design blogs showing you in great detail why it looks slightly shoddy if you scale from 512x512 down to 128x128 or 64x64, and how below 64x64 you just get into illegibility. For your app to look great you need hand tweaked assets for most resolutions. http://mrgan.tumblr.com/post/708404794/ios-app-icon-sizes http://bjango.com/articles/designingforretina2/
No, you don't understand. Of course, automatic scaling doesn't work.

Prepare two images - 512x512 and 32x32. Scale first one down to 32x32, subtract it from the second one and this will yield a arithmetic, per-pixel difference. Compress it. Now store 512x512 image and the compressed diff with an app. With these two, you will then be able to recreate original 32x32 (by scaling down 512x512 and applying the diff). And I am making an (educated) guess here that the compressed diff will take less space than the actual 32x32 image.

iOS already supports PNG8+a, which is much smaller than regular PNGs and a"CgBi" PNG variant that Xcode uses.
PNG8 is 256 colors, that's pretty limiting in very many cases. CgBI - I just looked it up - appears to be a speed optimization rather than a space one.
At least in web apps, a good part (I'd say 60-80%) of image assets can be converted almost lossly to 8-bits, including gradients/shadows (you can have alpha transparency).
If you did dynamic downloads you cold then run out of storage while doing this,mwhich would be a terrible experience.

Vector graphics help in some cases.

Would it be possible to ship with 1600 files, and then delete all assets when the download is complete, or at first run? That way you have one version of your app, and are ensured that the right size gets on your client. The download will remain large, but the storage requirements will only be high a short period of time.
Nope. The assets are part of the app bundle, which can't be modified. Doing so would break the code signature (DRM).
That is unfortunate.

I see people suggesting going with SVG or resizing a high resolution image, but there was a good post not long ago about the problem with SVG and blindly resizing. You really need your images tweaked on a per-size basis.

I can imagine you can get away with automatically resizing iPad HD -> iPad, but going down to the relatively tiny sizes for the smaller screens would be a bad idea IMO.

The first thing to go is always small size. In the modern age of cavernous storage and plenty of memory, it is nearly always the first thing to completely throw out the window. I don't expect Apple to reverse this.
400 graphic files! It must be a game of some sort, right?
Yup. It's probably closer to 500 files, but about 400 are affected by the quadrupling of files issue.