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
Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified
Accepted Solution

Web DB

Does anyone know the maximum size (ie. in MB) for a Web DB database on the Playbook?

Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: Web DB

Since SQLite is in memory, the max memory size is limited by the PlayBook device storage memory. So you’ll be able to store any medium to large sized data in the SQLite database.

Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified

Re: Web DB

Thanks for the quick reply!

Highlighted
Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Web DB

[ Edited ]

Except that each app has a 5MB storage space limit and that the user currently cannot accept for it to be extended when needed.

 

EDIT:

Most companies follow the official recommendations btw:

http://dev.w3.org/html5/webstorage/#disk-space

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified

Re: Web DB

Thank you.  That makes sense.

 

Do you know if the 5MB storage limit is entirely available for storage, or does that limit also include the size of the app?

 

Thanks in advance.

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Web DB

[ Edited ]

It's just for storage

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: Web DB

Here is a sample code which creates a database of size 100 MB for an app.

 

openDatabase('pbDB', '1.0', 'PlayBook DB', 100*1024*1024, null);

 

 

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Web DB

This doesn't mean anything, because there is no data in it.
--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: Web DB

The code snippet mentioned creates a database pbDB of allocated size in which you can add tables and hence insert data into it. May I know wat I missed out  Smiley Happy

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Web DB

There is no padding with sqlite, which basically means that it's up to the browser to complain and since every implementation is different, I've just built myself a class and a test case to find you what we have to work with on the PlayBook.

 

I have good news!

Apparently Web Storage has been fixed and the PlayBook will detect that you're asking for a lot of space and ask the user to confirm that he's OK with it. It's totally different than what you'll see on Chrome per example.

After that, you can fill the database and you won't hit a limit at 5MB (according to my tests). It's quite slow, but I haven't compared it to LocalStorage to see if it's a PlayBook or a WebDB limitation

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.