• On The Insider: Jerry Springer's Scariest Moment
advertisement
July 18, 2007 12:00 AM PDT

Ingeniously simple method for storing iPhone Web apps locally

by Ben Wilson
  • Font size
  • Print
  • 1 comment

W. Clawpaws, who maintains the Life with Lunchhooks blog has discovered an amazingly simple and simply amazing method that allows Web apps to be stored locally on the iPhone, presenting the first viable solution to a major point of contention for developers. Essentially, the method stores an entire set of HTML and JavaScript in a bookmark by utilizing the data: URL. All page content is thus stored in bookmark data, and can be accessed when no network connection exists -- even if the iPhone is in Airplane mode.

Click on the following link using an iPhone: Tip Calculator

Then press the " " button to add it as a bookmark.

You can now access this basic Tip Calculator (written by W. Clawpaws) by simply opening the saved bookmark, even with no active data connection.

W.Clawpaws has even posted a one-line Perl script that converts HTML into a data: URL.

There are a few caveats to the code that can be stored in bookmarks, and very large bookmark data files may crash the iPhone, but this is a truly tremendous bit of progress.

Recent posts from iPhone Atlas
Adult content: Risque iPhone apps
A clipboard manager and 2D fighting at its best: iPhone apps of the week
Ideal iPhone apps for frequent fliers
More possible iPad camera evidence surfaces
iPhone OS 3.2 Beta 4 yanks camera software support, developers gain gestures
Novothink's iPhone Solar Surge charging case finally shipping
Rumor: Multitasking coming to iPhone OS 4.0
TomTom and Magellan iPhone car kits go head to head
Add a Comment (Log in or register)
by Kee Hinckley July 25, 2007 6:13 AM PDT
The one-line perl script was very cool. But of course it only does the HTML. To make it really work you want to include all the images, css and javascript in the bookmark. So I ended up wasting a little time and...

http://www.somewhere.com/url2iphone.html

That will take any remote web page and convert it into a single data url that includes all the attached media. At least in Safari (Computer and iPhone) you can then click on the link to see the results. And of course you can save it to your bookmarks.

A couple caveats.
1. It looks like the iPhone has about a 32K limit on bookmark size. Leastwise I haven't gotten one to work that was bigger than that. Although it *can* click on links that contain larger data: statements, so in theory you could email one to yourself.

2. Storing a couple of these in your bookmarks slows down bookmark editing in Safari.

3. Don't point it at your favorite MySpace or news page. Those sites are way too big. You'll want to stick to widgets and iPhone web applications, preferably with minimal graphics.
Reply to this comment

Search iPhone Atlas

advertisement

About iPhone Atlas

iPhone Atlas helps you navigate the ins and outs of Apple iPhone ownership with how-tos, troubleshooting information, news, reviews, and more. Got a tip? Want to contact us? E-mail iphoneatlas@cnet.com.

Add this feed to your online news reader

iPhone Atlas topics