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

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
pnewhook
Posts: 70
Registered: ‎01-13-2011
My Device: Torch 9800 and Playbook

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
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

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

Re: Webworks local stage

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

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

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
ddluk
Posts: 212
Registered: ‎10-02-2010
My Device: Z10 and Z30

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.

Retired
tneil
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