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

BlackBerry® World™ Development

Reply
Contributor
Posts: 38
Registered: ‎08-06-2011
My Device: PlayBook
My Carrier: T-Mobile

How to distribute Lite and Pro versions without losing data on upgrade.

How do I package my PlayBook App so that there is a Lite version and a Pro version?  Can I do this using version numbers?

 

I want to do this in a way that if the user has the lite version installed and decides later to install the Pro version no data is lost. The way this app is currently constructed it saves data to the application’s private data area. If Lite and Pro have different app NAMES they will be seen by the PlayBook as different apps right? That would mean that they don’t share data (unless I re-write the app to use a shared area).  Can this be done with version numbers so that installing the Pro version upgrades the lite version in-place?

 

 

Thanks

Highlighted
Developer
Posts: 425
Registered: ‎03-17-2011
My Device: Developer
My Carrier: Telus

Re: How to distribute Lite and Pro versions without losing data on upgrade.

You can't do this with two versions of the same app because only the most recent approved version is active in App World.

 

I assume that both of your versions will be paid apps with different prices. If your LITE version is free it would be better to use the try-and-buy licensing model. But if you want two separate apps (with different names in App World) you can use the method I use for my apps two versions What's up and What's up DEMO.:

 

You can release your two versions as separate products (with different names specified in the Portal)  As long as you bundle both apps using the same sources and make sure NOT to change the value od the <id> tag within the xxx-app.xml file (not the blackberry-tablet.xml file), the two apps will use the same application data folder. Before you create your .bar files, set a flag in the code to either vers="lite" or vers="pro" to control which features are enabled in each version.

 

This works because the app id used by App World is generated by the contents of the <id> tag and your signing key. So assuming that you use the same signing key, both versions of your app are considered to be the same app for installation purposes.

 

I strongly suggest that you test the setup by loading your signed bars onto your device prior to uploading them to App World. There is one problem with this approach caused by a bug in the App World install process. When the pro version is installed over the lite version, both apps appear in the app list until the list is refreshed manually or until App World is restarted. If the user deletetes the lite version manually, the both apps are deleted (because they are really the same one) and the application data is lost. The pro version can be easily restored but the data will be long gone.

 

If this possibility worries you. you might consider an export option in the lite version and an import function in the pro version. If the data is saves in the shared storage folder, then you will have achieved your goal. There is a downside to this approach too, because the user may forget to back up the settings using the export option.

 

 

 

 

_________________________
In the dark and need a sky map?
Discover What's up at App World.
Follow What's up on Facebook

Contributor
Posts: 38
Registered: ‎08-06-2011
My Device: PlayBook
My Carrier: T-Mobile

Re: How to distribute Lite and Pro versions without losing data on upgrade.

Maurice, thank you for your excellent explanation. I had no idea that it would be possible to have two different app names be treated as the same app and use the same private strorage.  One thing though... my app is a PlayBook WebWorks application. There is no xxx-app.xml file. There is a config.xml file and a blackberry-tablet.xml file. I just checked the documentation config.xml file (here) and there is no <id> node. Are you aware of a differrent way to do this gievn my environment?

Developer
Posts: 425
Registered: ‎03-17-2011
My Device: Developer
My Carrier: Telus

Re: How to distribute Lite and Pro versions without losing data on upgrade.

There is a forum especially for Webworks developers. Someone there may be able to answer your question about how the app id is generated on that platform.

 

You can also do what I did and experiement with bundling and signing your app as two sepatate bars and loading locally to your device. You won't be able to replicate the two different App World names but you can certainly test the behaviour vis-a-vis application data. Good luck.

 

 

_________________________
In the dark and need a sky map?
Discover What's up at App World.
Follow What's up on Facebook