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
New Developer
Posts: 20
Registered: ‎01-05-2009
My Device: Not Specified

Is it possible to build a JRE 6.0 app to run on 5.0 device

Our entire application was initially written to the JRE 5.0 API. During testing we discovered that we need to utilize the ApplicationFolderIntegrationConfig class so our ApplicationIndicator can be intergrated into the Messages and HomeScreen.

 

Is it possible to build the app using JRE 6.0 and deploy it to devices using OS 5 as long we we check the OS version before using the JRE 6 class ApplicationFolderIntegrationConfig? Something like this:

 

ApplicationMessageFolder inbox = reg.registerFolder( MessageListDemo.INBOX_FOLDER_ID, "Inbox", messages.getInboxMessages());


if(DeviceInfo.getSoftwareVersion().startsWith("6")) {

   ApplicationFolderIntegrationConfig config = new ApplicationFolderIntegrationConfig(true, true, daemonDescr);inbox = reg.registerFolder( MessageListDemo.INBOX_FOLDER_ID, "Inbox", messages.getInboxMessages(), config);

}

 

If not, is there a way to conditionally compile 2 different binaries from the same project?

Developer
Posts: 207
Registered: ‎09-10-2010
My Device: Not Specified

Re: Is it possible to build a JRE 6.0 app to run on 5.0 device

No you can't run appliation build for 6.0 to run on 5.0. BB apps are forward compatible which means application build against older versions will run on newer versions. 

 

"If not, is there a way to conditionally compile 2 different binaries from the same project?"

 

Preprocssor Directive is what you need here.

Highlighted
New Developer
Posts: 20
Registered: ‎01-05-2009
My Device: Not Specified

Re: Is it possible to build a JRE 6.0 app to run on 5.0 device

Thanks for the quick response.

 

So if I go the Preprocessor Directive route, I can have one code base, include both JREs (5 & 6 in this case) and do a build for 5, then a build for 6?

Developer
Posts: 207
Registered: ‎09-10-2010
My Device: Not Specified

Re: Is it possible to build a JRE 6.0 app to run on 5.0 device

You can have one code base, but you can't include more than one JRE in project. First include 5.0 (or any JRE) in your project and build. Then remove this JRE and add another one from Build Configuration and build it. Also make sure that you add/remove preprocessor defines based on target build.

Go through the article, it has pretty detail and simple guide.

Note that, in the end you will have two versions of application which you have to make sure that correct version is deployed to the device with correct OS.