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

Adobe AIR Development

Reply
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Access SharedObject data in converted apps

I am looking to convert my current AIR apps to either Android/AIR apps or Cascades apps and am wondering how I would go about accessing the existing SharedObject data when using these different development enviroments.

 

For the Android/AIR app I had at least hoped that identical code could get the same objects, but apparently this does not work.

 

Any ideas?


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 1,096
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Access SharedObject data in converted apps

What part is not working?  Is the captive AIR runtime in Android not finding the SharedObject due to maybe being in a different BB10 directory in whatever sandbox structure is created for AIR-on-Android apps?  I would think that should be abstracted away by AIR filesystem API's, as long as the proper calls are made.  Or are you saying that you get a reference to your shared object but can't do CRUD operations because of some problem accessing the keys?

 

Not snarking you here, but rather a genuine question.  I have yet to look into the Android route for converting my AIR apps.

Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Access SharedObject data in converted apps

I have been unable to lock down exactlly where this is failing...


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Access SharedObject data in converted apps

I have looked into this a bit more and it can find the SharedObject, but the data always comes back with a value of 0


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Access SharedObject data in converted apps

I have just tried to get around this by saving the data in a SQLite table, but this also was not seen by the Android version of the app...


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 1,096
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Access SharedObject data in converted apps

It was claimed in the AIR porting office hours webcast that Android AIR apps should have access to existing user persisted data from the app sandbox of existing app installs, at least for sqlite db's.

 

At this point it would be very, very good to see working demo code demonstrating this assertion from BlackBerry, so that folks in this situation don't have to independently re-invent the wheel.

Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Access SharedObject data in converted apps

My experience is that SQLite doesn't work any better than SharedObjects.

 

As you said I would love to see a working demo of an Android app that is able to read user data from an AIR app...


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 1,096
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Access SharedObject data in converted apps

[ Edited ]

The sooner we can see such demo code the better.

 

Because if it turns out that Android AIR apps in fact cannot access existing user persisted data in existing installs of native AIR apps, then devs are going to need to:

 

1) Create an update to existing native AIR apps that exports user persisted data (if the app does not already have this functionality), and get users to understand that it's important for them to download that update, prior to them ever updating their OS to 10.3.1 when that drops, and prior to them downloading the next, Android AIR version of the app.

2) Make sure users understand that just before they download the next, Android AIR version of the app, they need to export their then-current persisted data.

3) Create the Android AIR version of their app, and add a persisted data import function if it does not already exist.

4) Release the two app updates in sequence and with enough time between the two updates and the release of 10.3.1 that users understand what they need to do to hang on to their persisted data, and do it, without skipping any steps in the sequence.

 

This is very messy, to put it mildly.

Developer
Posts: 1,096
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Access SharedObject data in converted apps

And by the way, if the above described sequence turns out to be necessary, it's very likely that some users will not get the memo, will end up losing their persisted data, and will blast developers in app reviews and forums for that.

New Contributor
Posts: 2
Registered: ‎04-17-2014
My Device: z10
My Carrier: unknown

Re: Access SharedObject data in converted apps

And the final answer is Android-ported apps are not able to read the SharedObject data, and users will lose all their persisted data when updating to 10.3.1. Its really a nightmare! We must follow these complicated steps above to avoid one star rating, complain emails. Its not a perfect change at all :smileysad: