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
Contributor
rg_bb
Posts: 21
Registered: ‎04-25-2012
My Device: 9800
My Carrier: Vodafone

HTML5 Local Storage on BBOS6 - Supported Versions?

Hi,

 

The WebWorks API states:

This API supports BlackBerry 6.0; however, some BlackBerry 6.0 dot revisions may not be fully supported.

Is there a definive list of which revisions support Local Storage fully?

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: HTML5 Local Storage on BBOS6 - Supported Versions?

There isn't a definitive list as far as I am aware. I believe this has to do with earlier release versions vs. newer release versions, but I'll check to see if I can get some specifics.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: HTML5 Local Storage on BBOS6 - Supported Versions?

Start off checking if you have it at all

 

    if(typeof localStorage == 'undefined') {

      // Fallback to some other mechanism

      } else {

        if(typeof localStorage.getItem == 'undefined') {

        // Fallback to some other mechanism

        }

        if(typeof localStorage.setItem == 'undefined') {

        // Fallback to some other mechanism

        }

        if(typeof localStorage.removeItem == 'undefined') {

        // Fallback to some other mechanism

        }

      }

 

Fallback mechanisms can be varied

 

If you only need to save small quantities of Data cookies are fine

 

JSON to a server allows pretty unlimited storage - but you need a server of course

 

There are several other fallbacks available - Nokia S60 (worst example I can think of) is really had for all fallbacks for example but can still handle a DB layer.

 

BB5 is a little better and has DB support (the browser is a nightmare though)




Click the like button if you find my posts useful!
Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: HTML5 Local Storage on BBOS6 - Supported Versions?

I'd agree with peardox's approach in verifying that the objects exist. I've tried to dig up specific dot revisions but can't seem to find documentation around it. 


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
Contributor
rg_bb
Posts: 21
Registered: ‎04-25-2012
My Device: 9800
My Carrier: Vodafone

Re: HTML5 Local Storage on BBOS6 - Supported Versions?

Thanks for the feedback. I have used the workarounds suggested on the MDN to save small amounts of data. This seems to work in most use cases, except after the battery is replaced in the device...

https://developer.mozilla.org/en-US/docs/DOM/Storage#localStorage

Please use plain text.