For those who do this on the iPhone 2.1 (possibly 2.0), you do not need to create special services for local data storage. MobileSafari seems to support the HTML5 / WHATWG SQL database API. This is the same API that is supported by the latest versions of the desktop Safari and Firefox.
If you use a tool kit like Dojo or ExtJS that offers storage abstraction, your code should work with almost any modern browser, including MobileSafari.
To check, open http://robertsanders.name/dev/stackoverflow/html5.html on your iPhone.
If you open this page, look at the Jailbroken iPhone file system, you will see a database somewhere in / private / var / mobile / Library / WebKit / Databases /. There is even a catalog of databases opened on the Internet.
root # sqlite3 / private / var / mobile / Library / WebKit / Databases / Databases.db SQLite version 3.5.9 Enter ".help" for the statement
sqlite> .databases seq name file
0 main / private / var / mobile / Library / WebKit / Databases / Databases.db
sqlite> .tables
Database sources
sqlite> select * from the Database;
1 | http_robertsanders.name_0 | Note | Database | API Example | 20000 | 0000000000000001.db
sqlite> select * from Origins;
http_robertsanders.name_0 | 5242880
Robert Sanders Sep 21 '08 at 23:29 2008-09-21 23:29
source share