Blackberry OS version - blackberry

If I develop Blackberry application for OS version 6.0, will the application be compatible with OS version 4.5? If not, is there some way to port the application easily?

If you develop against a specific SDK (eg 6.0) your application will only be deployable to devices that use the matching OS version (6.0 in this case).
In order to develop applications that specifically target different OS versions, you must build separate deployable binaries for each version. Alternatively, you can build for the lowest common denominator -- if you want to support OS 4.5, build for 4.5 and your app will run (though not always gracefully) on all later BB OS versions.
Two open source projects that you can use for examples are BBSSH and LogicMail.
Neither of these uses preprocessor directives, however both take slightly different approaches to managing multiple target OS's; which solution is more appropriate is best determined by your own needs. Both use ant-based builds; and I think both target from OS 4.5 to 6.0. (Older versions of LogicMail target back to 4.1 I believe)
Build scripts can be found here:
BBSSH SVN (build.xml,build-impl.xml, build.properties)
LogicMail SVN (build.xml, build.properties)
Both projects can also be looked to for specific methods of handling things like utilizing features introduced in later OS versions seamlessly to your users -- either providing a custom implementation prior for earlier versions, or disabling the functionality as is appropriate.
Finally a quick note: if you continue to not accept valid answers, you'll soon find that people are less willing to answer you.

Try to use "Preprocessor Directives" to support multiple blackberry devices.

I m not 100% sure but probably not, because version 6.0 uses newer libraries.But try develope in lower version os and it will run at higher version.
hope it helps
Wblade

For an example of a quality open source project that supports many different BB OS versions, check out LogicMail.
The ant build.xml loads platform-specific classes based on the target:
<if><isset property="jde460.home"/><then>
<fileset id="bb460_fileset" dir="..">
<include .../>
...
As far as I can tell, this project does not rely on the preprocessor.

Related

Base SDK Missing

I get the "BASE SDK Missing" when re-opeing projects. (I got the latest build of xcode, and latest SDK installed.)
It seems to be happening when I quit a project, (not exiting xcode), and re-open the project after a while. I have tried both, with and without my iPhone plugged in. I have tried to fix the problem like described here, but it does not help for me. - It just makes it even worse! (unrecognizable SDK)
The only way I have managed to get it back to normal, is to do a manual re-boot of my mac, plugged in my phone, waited until it has checked my iPhone, and then, opened xcode. Time consuming and annoying!
Why does it happen and what is the trick to fix this?
Your recent upgrade of Xcode likely removed the earlier SDK that your project was set to use. There are a couple of solutions for the problem. The most simple solution is to always select the "Latest" SDK in your project's settings and not select a specific option. You may be uncomfortable with the idea and want to run your app on an older device but it's important you understand that all of the newer SDKs can generate code that works on older versions of iOS. There's a separate hard to remember option for setting the deploy target. (It took me a while to learn how/why to use this but it's well worth it.)
The second option is to actually find a version of the SDK that your project is set to and attempt to reinstall it. I suggest going this route only if necessary as it's not guaranteed to work in each case. Older SDKs may or may not work in later versions of Xcode (Eg. SDK 3.0 might not work in Xcode 4.3.2) due to major changes in the toolchains. Tools like gcc/gdb are deprecated in favor of llvm/lldb. Still, you may have a valid reason for using an older SDK. You may have to fix a bug that is present only when using the older toolchain or you may need to reproduce a problem that only happens with builds generated from your build server. In many of these cases it might be easier to upgrade where the problem occurs (Eg. upgrade the tools on the build server) or downgrade your dev environment. (Install an older version of Xcode.)
The reasoning behind the frustration is that Apple highly encourages rapid adoption of it's latest tools and technologies. It creates a better product as the dev community is forced to stay current and competitive while the users are forced to maintain upgrades to ensure apps continue to work. This is in contrast with the traditional model of backward compatibility allowing developers to support revision -n of a product/platform. It is also great for business since rapid adoption of the latest often encourages purchase of newer hardware and products to get the best experience. The rapid adoption ensures the more robust software along with bug fixes, enhancements make it to the majority of consumers overall increasing their penetration in the market.
You have to set your target and project's base SDK to "Latest" and not an explicit option. If you choose one explicitly it seems to break if you update xcode versions.

Compiling different scetions for different version - Java

Is there any way to compile BlackBerry Java code for different sections using eclipse ?
There is a class named LocationInfo available in BB version OS 6.0 onwards.
I get a compilation error if try to compile for OS 5 (because LocationInfo is
not defined)
But if I compile my code for OS 6, I wont be able to deploy on any 5 based devices.
I want to my code base to be of version 5 and support the methods of Locationinfo (which is available only in 6.0 onwards).
Is a sectional compile possible or is there any work around for this ?
Thanks
Try the BlackBerry preprocessor
Coding for Multiple Blackberry Devices - Using Preprocessor Directives in Eclipse
The OP wanted to know whether there was a way to a class available in os 6.0 , in an os 5.0 device. The blackberry processor does help in creating builds for different versions, but doesnt answer the question. The OP would like to know whether there is the blackberry equivalent to androids "Support Package" or the "Compatibility package" which allows to use APIs that are not available for older platform versions.
Sorry , but there is no similar package on blackberry which you can use to address your issue.
You will have to use blackberry pre processor and then develop features for different devices based on the os they provide. Later OS's will have more apis you can play with, so you can implement better features on those. In earlier OS's you are stuck with using the restricted set of api methods, and hence some features may not be implemented on those.
Hope this helps

What do you need to do to create a single package for blackberry OS5 and OS6 devices?

A newb question and one I haven't been able to see much advice on, but is it possible to create a single package that will install and run on both blackberry OS5 and OS6 devices?
I want to avoid preprocessing or creation of two different COD files.
I am not using anything special that differs between the two OS's (afaik!)
Yes, absolutely. So far, RIM has made all of it's OS revisions backwards-compatible. So anything you write against any given OS version will work on that version and all newer versions.
That's not to say that you won't run into funny quirks when moving to newer OS versions, but your code will execute without recompilation. You just can't take advantage of any of the newer OS's API changes without doing preprocessing.
Basically in this case you just should not use APIs which were added in OS6.

Targeting Multiple Blackberry Devices

I am trying to target a Blackberry application to multiple devices, since there are advanced graphics needed. I would like to avoid writing multiple versions (as suggested here). The target is OS version 5.0, and so far it works as expected on storm2 simulator.
The issue is when I run it on the Bold simulator, the EditFields are not accepting input from the keyboard.
I can't seem to find any example how actually go about supporting multiple devices.
Thanks,
MD
There are a lot of good links in this question.
In particular, Marc's answer contains links to actual projects which support many OS versions that you can explore and mimic.
Use only the components available to 4.5 and it should work on all different OS versions.
Or make your own custom components.

Will JRE 1.4 support classes compiled with Java 1.5 & 1.6?

Will code compiled using 1.5 and 1.6 run on a 1.4 JRE? We weren't sure which Java versions the 1.4 JRE supports.
We know that if the code in question implements 1.5 or 1.6 supported features then it definitely won't compile... and that there are some risks with "backwards compiling" but wasn't sure if the 1.4 JRE would refuse to even load the 1.5/1.6 compiled classes or not.
Update: I confirmed you get a java.lang.UnsupportedClassVersionError exception if you run an 1.6 class file on JRE 1.4.
You can cross-compile. This document shows you how:
http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html#crosscomp-example
You must specify the specific major version you're targeting (1.4, it sounds like).
Using this technique, your best bet is to always use the newest javac you can find! That way you have all the latest bug fixes and performance improvements, and it's perfectly safe.
EDIT: note that this does address the problem of library incompatibilities, which was discussed in several answers!
Only if you compile with javac -target 1.4 switch.
Obviously you will not be able to use 1.5+ features, such as Generics, Executors, etc.
If you just build with the defaults of javac 1.6, your class files will not work on old versions of Java.
The best way to compile for older Java is just to use the older JDK releases. But if you really want to try to compile for older Java from newer, here are some instructions:
How to cross-compile for older platform versions
Source, target, class file version decoder ring
You also might be interested in http://en.wikipedia.org/wiki/Java_backporting_tools
I don't think it will.
Occasionally (for reasons too complicated to explain), I try to run code in a 1.5 JRE that I compiled in a 1.6 JDK. It typically throws a java.lang.UnsupportedClassVersionError exception.
Yes and no. You can run code compiled under Java 6 on a 1.4 jvm if you set the "source" and "target" javac options to the version you are targeting (e.g. 1.4) when you compile them. This will work in cases where you have not used any of the additional classes or language features that were added since the target version.
Good luck.
Yes, you can produce class files that are compatible with 1.4 with the 1.6 compiler (javac) however, simply doing this is not necessarily going to produce code that will work. The problem is that that will still compile against the 1.6 version of the API.
At first glance you would not expect this to be a problem since the contracts should not change but it is - I had a problem in that a new constructor that takes IIRC an integer was added to BigDecimal (in 1.5) and so at compile time the call to that constructor was specified however at runtime that constructor did not exist and so a runtime exception. You're probably going to have issues like this when methods are overloaded and you're relying on auto variable conversion.
The Javac app is in fact independent of the version of Java that it belongs to - you can specify a different API to use against 1.6 javac and in order to obviate any runtime issues this should be done.
Java 1.5 was a major release where it introduced enums,autoboxing and other stuffs.while compiling you will get exception saying unsupported class version.But if you compile with the command javac -source 1.4 -target 1._ claasname.java it will compile.
If you are using features of 1.5 like auto boxing and enums in that scenario it won't compile since these features are not available in 1.4.In this case we need to convert our code to older versions based on some tools.

Resources