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

Java Development

Reply
Developer
Posts: 64
Registered: ‎08-07-2008
My Device: Not Specified

one version APP running on multiple OSs

I want to release a Blackberry APP that could run on all the Blackberry with OS higher than 4.3.

 

Since API are different between OS versions, I wonder what could be a smart way of achieve this? The whole point is that when customers are trying to download my application, I don't want them to bother to check what OS he/she is currently using and select the my application related to correct OS version. Instead, I prefer them directly load one build that could run on any blackberry(4.3, 4.5, 4.6, 4.7).

 

For example, my code has API call to jsr135, which is only supported after OS4.5. So, if I found this current user's device OS is lower then 4.5, the API call to JSR135 will be disabled and give a Dialog msg saying "Your current OS doesn't support camera call".

 

What could be a good solution for this?

 

Thanks.

 

 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: one version APP running on multiple OSs

Many of us are struggling with this issue.

 

For most of our stuff, we actually build several versions and post them all OTA. The download landing page queries the User-Agent data and directs the browser to the correct JAD file. It is transparent to the user.

 

In the past, we had several code branches that handled the incremental changes for the newer OS levels.

 

Today, we have one source tree and make very judicious use of the preprocessor. For the version critical stuff, we define an interface and a factory class to return an object appropriate for the device.

 

There are other ways to do this as well. Nothing is perfect or even "right": you choose the method that gives you the least friction for your particular situation.

Developer
Posts: 53
Registered: ‎12-11-2008
My Device: Not Specified

Re: one version APP running on multiple OSs

Hi RexDoug, may I ask you what kind of preprocessor you are using?

I use the same way of factories and interfaces defenition, but I have to have several projects for each OS version because each project contains different set of files depending on BB API.

 

If you use only one project file, could you please share your solution with other?