Question

I want to build jQueryMobile app using IndexedDB technology for databases. While developing in web browser the app is working. How can I convert this app into native android app (using phonegap) and to keep the data from IndexedDB database? I know that location of my IndexedDB database is at:

C:\Users\<User Name>\AppData\Local\Google\Chrome\User Data\Default\IndexedDB\

So is there a way for my app to use IndexedDB at the mobile devices ? For conversion I'am using phonegap cloud but the converted app does not have access to the database. I'am testing with Nexus 7 tablet. The app on my PC works great.

EDIT 1: I'am testing with Google Nexus 7 tablet. Android version is 4.4.2 so i suppose that IndexedDB is supported on my device. The problem is that I don't have idea how to implement the file from the location above (what to do with it) while conversion, so that the database would be found on my device. (I'am using phonegap cloud for conversion).

Was it helpful?

Solution

unfortunatly IndexedDB is not supported by android browser before version 4.4.

Check this page for availability : http://caniuse.com/indexeddb

There seems to be a way, look at Iwona Trąbka's answer on this page.

Or you can use something like Lawnchair to encapsulate database access.

OTHER TIPS

Please go through this link for the support, INDEXDB SUPPORT

I had tested it on android 4.3 and it did not worked but here it shows it has support on 4.4.

Also, please go through this blog for IOS

On Android 4.x an older version is implemented but on Android 4.4 it should work without plugins. I use a polyfill for iOS and Android which actually uses websql. The polyfill adds the indexedDB API while I isn't actually supported and converts the calls to websql!

websql is supported on android 2+. See the indexedDBShim for details: https://github.com/axemclion/IndexedDBShim/

Note: The polyfill isn't perfect, not all methods support an IDDBKeyRange but you can workaround it in most cases. It does workvon iOS 4+ if you want to support iOS in the future.

Edit: Also the answer your question, you can just open the database by name. There is no need to know the actual location on disk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top