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: 6
Registered: ‎12-11-2009
My Device: Not Specified

Support multiple BB device types.

Hi, I'm new to Blackberry Development.  I've been going through some of the tutorials and other Documentation, and noticed that there are different recommended best practices for different BB devices (e.g. Those with trackball  or trackpad vs. touch screen, etc.)

 

My question is, should I maintain different source code branches for different device types, or is there a way to tell what device it is, and the sprinkle the code with if/then where needed?

 

Thanks for your help,

Victor Ewert
http://www.ewert-technologies.ca
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Support multiple BB device types.

[ Edited ]

Welcome!

 

An often asked question as I'm sure you would have guessed.  There are many answers, depending on the type of company (for example, if they use automated build processes) and the type of application.

 

The curve ball is the requirement for different OS's.  OS's are forwards but not backwards compatible.  For example, if you are compiling for an OS 4.5 device (Curve 8300), you can not include stuff that is specific to the Storm (OS 4.7), because the OS 4.5 won't recognize it.  Even if you never run the portion of code with the OS 4.7 API call, if there is 4.7 (for example, touch screen) specific code in your built application, your application will not run on a device that runs an OS before 4.7.

 

You can use a preprocessor on a single code base to get round this problem, so you require multiple builds depending on your OS requirements.  Or have multiple projects with multiple branches.

 

Second curve ball is the Storm's habit of running in compatibility mode if the application was compiled for an OS before 4.7.  So to get a Storm running nicely immeidately you have to compile using 4.7 OS. 

 

I have it easier than most, we focus on the corporate world and generally target a base level (currently 4.2.1), so only offer the functionality for 4.2.1.  So we have two builds, one compiled using 4.2.1 for 4.2.1 and above and one fcompiled using 4.7 for that level and above.  We try to make the code identical in both so we have just two compiles. 

 

People in consumer space have much more complicated lives, I will let someone else answer for that and provide other alternatives.

 

In addition, as I mentioned, this or a similar question gets asked frequently.  Sorry I don't have a list of useful Threads, but I do recommend you search round.  If you find something useful, stick a reference in this Thread.  Thanks

 

Hope this helps.

Developer
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch

Re: Support multiple BB device types.

You can follow one simple rule in selecting JDE for development for all devices.

JDE version no. <= min(Supported devices OS version).

 

This will give you forward compatibility across devices but you won't be able to use advance/special APIs/features of

advanced JDE like touchscreen.

 

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
Developer
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch

Re: Support multiple BB device types.

you can use DeviceInfo API to detect the properties of device.

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
New Developer
Posts: 6
Registered: ‎12-11-2009
My Device: Not Specified

Re: Support multiple BB device types.

Thanks for your input.  I hope this isn't a dumb question but does Blackberry OS version of 4.5 mean that the jre is also version 4.5, i.e. does the OS version correspond to the jre version?

 

I'm planning on developing general consumer apps, so what is a good base to start from.  From looking at the Blackberry app store, most apps seem to support 4.2 and above, is that reasonable?

 

Thanks again,

Victor Ewert
http://www.ewert-technologies.ca
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Support multiple BB device types.

[ Edited ]

JRE means Java Runtime Environment and is usually associated with the level of Java you have installed on your PC.

 

Here is a KB article that answers the question I think you were asking.

 

What Is - Appropriate version of the BlackBerry JDE
Article Number: DB-00537
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800738/800901/What_Is...

 

 

Re the level to use, in my opinion, the earliest you should consider is 4.2.1.  You are right about App World and 4.2, but there are some useful facilities in 4.2.1 which are not in 4.2, the only phone that ever had 4.2 on it was the original Pearl 8100, and there are upgrades for that to 4.2.1 and 4.5.

 

However there were also some very useful UI improvements made in 4.6, so after 4.2.1, that is the next base level I would consider.

 

In terms of market share, figures I have seen suggest that at worst, you will lose 3% of the market if you only support 4.2.1 and above, but over 50% of the market if you only support 4.6 and above.  However, downloads from App World would suggest that 80% or the active market is 4.6 and above. 

 

The other determinant could be facilities, for example, if you want to integrate the camera into your app, then you need 4.6 and above to do it nicely.

 

Hope this helps.

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

Re: Support multiple BB device types.

This fairly recent KB article seems to be right on point...

 

http://ipoint.to/QmtlAQ


Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Support multiple BB device types.

Excellent link sugarat, I've not seen that.