Get the source and run on Eclipse
The last blog post demonstrated using the IndexedDB API on Cordova (Phonegap) - iOS. Using the IndexedDB API was simple; with just a requirement to add a delay to IndexedDB operations so that the IndexedDB polyfill can be done with its housekeeping database activities.
This post takes the idea furthur and demonstrated the use of IndexedDB with Cordova on Android based devices. The source code is available here and can be opened with Eclipse to see it in action. The screenshots below show it in action.
Getting it to work on Android gets a little trickier. The IndexedDB Shim starts doing housekeeping tasks like creating tables for database versions, etc. as soon as it is loaded. In case of Android, WebSQL operations must be performed till the deviceready is fired. In case such an operation starts, the native implementation seems to kick in and all future operations seem to fail.
Watch out this space for updates on my experiments with IndexedDB. Next activity - getting it to work with Windows Phone 7 ? B2G already supports it natively !!