Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 2
Registered: ‎05-27-2013
My Device: z10
My Carrier: t-mobile

HTML5 Database (without SD Card)

[ Edited ]

Hi guys,

 

i recently buy a z10 devices to make some test with my working app and im stuck in html database storage ... 

 

z10 cames without external sd card memory api database paper:

 

https://developer.blackberry.com/html5/apis/database.html

 

the only way to use "window.openDatabse" is with sd card ... its a joke or im doing something wrong ... 

 

here my code, when i try to execute the following code and "SECURITY_ERR: DOM Exception 18" ...

 

var
  db,
  database_name = "foo",
  database_version = "1.0",
  database_displayname = "Foo DB",
  database_size = "2 * 1024 * 1024"; // 2mb

// helpers

function openDatabase(callback) {
  var delegate = function () {
    (callback || successCB)(db);
  };
  if (typeof db === "undefined") { // single open
    try{
      db = window.openDatabase(database_name, database_version, database_displayname, database_size);
    } catch(e) {
      alert('Error: ' + e);
    }
    db.transaction(function (transaction) {
      transaction.executeSql('CREATE TABLE IF NOT EXISTS persistence (key TEXT PRIMARY KEY, value TEXT)');
    }, errorCB, delegate);
  } else {
    delegate();
  }
}

 

im using phonegap / cordova (2.7) and the code was executed after "deviceready" ...

 

thks !

 

 

 

Highlighted
Retired
Posts: 71
Registered: ‎09-19-2012
My Device: No sleep til BlackBerry 10
My Carrier: Bell

Re: HTML5 Database (without SD Card)

The documentation seems to imply that only 5.x devices require an SD Card for HTML5 Database.  Have you since been able to resolve this issue?

------------------------------
@grahamzibar
-_- zZZ
New Contributor
Posts: 2
Registered: ‎05-27-2013
My Device: z10
My Carrier: t-mobile

Re: HTML5 Database (without SD Card)

noup, I could not... i use localstorage ... ugly but its persist fine ...

Retired
Posts: 71
Registered: ‎09-19-2012
My Device: No sleep til BlackBerry 10
My Carrier: Bell

Re: HTML5 Database (without SD Card)

Fair enough! Lacks data relationships though Smiley Sad

Did you ever try IndexedDB? Just curious Smiley Happy
------------------------------
@grahamzibar
-_- zZZ