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
Related
I have to build a app that should support Blackberry OS 5,6,7. My question is would one app would be enough or do I have to build 2 separate apps?
i.e 1 compatible with OS 5 and 2nd with OS 6 and 7.
Also I would like to know if there are any open source graph API's for Blackberry 5,6,7 or not!
Please guide me!
Thanks
You may build for 5, 6 and 7 at one time. Use pre-processor directives to avoid compilation problems for multiple OS's. Then you would need to check separately for UI items depending upon the screen resolution and OS version. One quick check can be Display.getWidth().
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.
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.
How can i develop BlackBerry JRE independent java code for an application. Here we have so many types of JREs for blackberry so i would like to run my code in all versions without having code modifications. For example, in iphone we use preprocessor statements to avoid versioning problem like that do we have any alternatives?
Thanks
venu
There is a preprocessor for BB as well. See the docs for how to use it.
What is difference between Blackberry OS 4.6 and 5.0?
Thanks.
Two major differences that I've found are that SQLite does not work on anything below OS5.0 (though it only 75% works on OS5.0 anyway) and that BrowserField2 does not work in anything below OS5.
Really? Try to compile your code using a different JDK and see what happens :)
That's sort of a vague question. From the developers side you can look at the differences between the 4.6 API and the 5.0 API yourself. The major additions I noticed were the accelerometer classes and the ConnectionFactory.
From the user side you can google any number of articles on new features for 5.0. Here are a couple I found: BoyGeniusReports, PCMag.
If you tell us more about your application we might be able to tell you whether you'd likely need to use the 5.0 OS or not.