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
Posts: 13
Registered: ‎04-25-2010
My Device: Blackberry Curve 8550
My Carrier: Vodacom

Webworks local stage

Hi, am using http://westcoastlogic.com/lawnchair/ to store data in my application... Lawnchair doesn't work in Blackberry Web Works... What framework can I use? Please advise. Thanks

New Developer
Posts: 70
Registered: ‎01-13-2011
My Device: Torch 9800 and Playbook
My Carrier: Rogers

Re: Webworks local stage

What does Lawnchair use as it's storage mechanism? Just a simple JavaScript object. I'm curious why it doesn't work.

 

In any event, you get Web SQL database support in WebWorks for Playbook (not sure about smartphone support). While this standard isn't in development by W3C anymore, it's a very capable storage solution. Here' s a guide http://html5doctor.com/introducing-web-sql-databases/

Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: Webworks local stage

[ Edited ]

How sophisticated does your data storage need to be?

 

I'm doing just fine with:

 

 

// retrieve

retrievedVar = localStorage.getItem('somekey');

// store

localStorage.setItem('somekey', somevalue);

 

 

In order to store more complicated structures I use JSON.js and apply JSON.stringify(object) before storing it so that it's a string and then use JSON.parse(retrievedVar) to get it back.

 

Unless you need SQL-like functionality this works like a charm!

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Contributor
Posts: 13
Registered: ‎04-25-2010
My Device: Blackberry Curve 8550
My Carrier: Vodacom

Re: Webworks local stage

I tried to use local storage directly but not working... am using the latest WebWorks with Phonegap.

Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: Webworks local stage

Can you be a bit more elaborate on what doesn't work?

 

Post some code maybe...

 

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Developer
Posts: 213
Registered: ‎10-02-2010
My Device: Z10 and Z30
My Carrier: Play and Plus

Re: Webworks local stage

I created the sample code few weeks ago:

 

https://github.com/ddluk/WebWorks-Database

 

This code is working on Playbook and BlackBerry smartphones.

Highlighted
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Webworks local stage

Can you post up the device model and OS version (5.0, 6.0, PlayBook) that you are using

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter