I’m working on an ipad application that needs to work with images; it uses four different versions of each image in different situations (each has its own resolution and image quality).
The options I have to get the images in the app are:
1) Download only the original image. Convert the image into several formats on the ipad. CPU/mem consumption on ipad will be larger, bandwidth will be lower.
2) Convert the image into several formats on the server, download all the variants to the ipad. CPU/mem consumption on ipad will be low, bandwidth usage will be higher and download times will be
longer.
From your experience, which of these solutions is the best practice? And would your approach be different if you know up front whether or not the application will be mostly used using wifi or on the road using 3G?
As you’re assuming most people will be using WiFi, I say resize on the server:
First, memory/speed. While you can spawn multiple threads on the iPad to speed up resizing to multiple formats, this will only get you so far as you’re rather constrained memory-wise. Merely loading one 1600×1200 image will easily rack up 40M on its own. Multiple formats in multiple threads might get you in trouble (like getting killed for not having enough memory). Your server will have multiple gigs of RAM and multiple processors. The iPad just isn’t going to beat that. The downside, ofcourse, is that you are going to have to maintain a companion site for the lifetime of your application.
Secondly, having it on the server and not hardcoding the exact formats in your iPad application will give you more freedom when you decide to change (or bugfix) something with your formats. Changing server-side code is, obviously, much easier than redeploying your iPad app to the App Store with a little tweak (and having some people upgrade and some not).
I wouldn’t worry to much about bandwidth consumption, but make sure to make note of it when your user is on a 3G connection (use the Reachability API).