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: 58
Registered: ‎01-19-2011
My Device: 9800
My Carrier: vodafone

how do i share data between applications

I seem to have been flooding the forum recently... sorry for taking up the space.

 

BACK ON TOPIC:

 

I have two applications that needs to share data.

 

HTML5 database does not allow that.

 

Localstorage only works on OS6

 

I went for cookies but that wont work either....

 

What kind of global storage is available for me to use?

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

Re: how do i share data between applications

Hi genvej,

 

Trying saving the data to a file located at shared folder. Then you could read the same file from both your applications. But at the same time it is accessible by other apps also. Smiley Wink

Regular Contributor
Posts: 58
Registered: ‎01-19-2011
My Device: 9800
My Carrier: vodafone

Re: how do i share data between applications

[ Edited ]

I really hope there is a better solution than that (thx for the input though!!, which may be the way if no other options exist).

How on earth are we supposed to write superapps if there is no way that allow applications to talk to eachother.... Sure there may be security concerns when sharing databases or cookies(!?!?), but let us for Gods sake have, at least, the option to do what we want

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

Re: how do i share data between applications

All SQLite databases coming from the browser/WebWorks are encrypted using unique keys for each application.  This makes it so that multiple WebWorks applications cannot access the same database.

 

Your other options are:

 

1) Saving your data to XML, JSON files on the file system and sharing them in the same location.  This would have the same security limitations as a shared SQLite DB.  Anyone could access them and anyone can delete them.

 

2) If you are looking to pass data between two applications you can invoke those applications using the invoke API and pass data to each application.  You can configure multiple entry points in your application to be able to handle the data passed in.  Essentially you will recieve the data passed to your application as query string parameters on the URL of the paged called in the invoke

 

To invoke another application in this manner you will need to invoke with JavaArguments 

http://www.blackberry.com/developers/docs/webworks/api/blackberry.invoke.JavaArguments.html

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
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: how do i share data between applications

What about on the PlayBook?

 

1) saveFile() is not implemented. What can we use to save a JSON object in the shared folder?

2) Invoke cannot be used that way. Is there something else we can use?

 

 

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

Re: how do i share data between applications

[ Edited ]

You could write a custom javascript extension to write byte data to a file. With this you could save a JSON object to a file in shared folder of Playbook.