语言

Menu
Sites
Language
IndexedDB
 
I am trying to use IndexedDB in a Tizen webapp.  The spec says that Tizen apps should be able to use IndexedDB and there is even the following example code on the Tizen developers site:
 
<script>
   if (!window.indexedDB) {
      window.alert("Does not support IndexedDB");
   } else{
      var tizenDB = {}
      var request = window.indexedDB.open("TizenIndexedDB");

      console.log(request); //The created indexedDB can be checked.

      request.onsuccess = function(e) {
         //
      }
      request.onerror = function(e) {
         console.log(e);
      }
   } 
</script>

However, when I try to run this code in a Tizen app, I get an alert saying that IndexedDB is not supported.  Any suggestions would be greatly appreciated.

Thanks!

Michael Hilton

 

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

10 回复
Raghu Kona
Hi Michael, Even after adding the privilege http://tizen.org/privilege/unlimitedstorage, got the same message "Does not support IndexedDB". I raised a Jira request on this issue. Please follow the link for updates. https://bugs.tizen.org/jira/browse/TWEB-142 Regards, Raghu Kona
haithem rahmani
this issue hasn't been solved yet with the 2.2.
haithem rahmani
how can work with databases in web apps then?
Alexander AVSukhov
Hi Michael, Try to use following code:
Tiana Sweeney
This worked for me. They use a webkitIndexedDB, so you can leave the rest out (in this case). So replace: window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; with: window.indexedDB = window.webkitIndexedDB; Should still work.
konduri sai swathi
Hi, Try the below code :
var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);
openDatabase() opens a database with the name "mydb"
Lakshmi Prathyusha

I tried this one for opening my database, but it is existing database. Not working i'm using 2.2.0.

 

Sungsuh Park
You can insert below code to use indexeddb but it looks like very unstable now.
.
    if ( 'webkitIndexedDB' in window ) { 
        window.IDBCursor = window.webkitIDBCursor;
        window.IDBDatabase = window.webkitIDBDatabase;
        window.IDBDatabaseError = window.webkitIDBDatabaseError;
        window.IDBDatabaseException = window.webkitIDBDatabaseException;
        window.IDBErrorEvent = window.webkitIDBErrorEvent;
        window.IDBEvent = window.webkitIDBEvent;
        window.IDBFactory = window.webkitIDBFactory;
        window.IDBIndex = window.webkitIDBIndex;
        window.IDBKeyRange = window.webkitIDBKeyRange;
        window.IDBObjectStore = window.webkitIDBObjectStore;
        window.IDBRequest = window.webkitIDBRequest;
        window.IDBSuccessEvent = window.webkitIDBSuccessEvent;
        window.IDBTransaction = window.webkitIDBTransaction;
        window.indexedDB = window.webkitIndexedDB;
    }
JAY LEE
Hi I'm developing Tizen webapp. My app has an web worker and creates an indexed db within the worker. I tried my code with desktop chrome. it worked well. But Tizen always failed to open indexed db with worker. Am I missing something or current Tizen build(sdk 2.1) does not support indexeddb with web worker?
Alexander Zaitsev
It seems like an issue https://bugs.tizen.org/jira/browse/TWEB-142