BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 08-24-2009, 09:31 AM   #1 (permalink)
Knows Where the Search Button Is
Join Date: Jun 2009
Model: 8300
Carrier: Rogers
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Blackberry Code not really forward compatable?

Please Login to Remove!

Hey experts,

I am fairly new to BB development. I had read that blackberry code is forwards compatable. So if i coded my app for a blackberry curve, it would work on an newer phone (ie. newer OS) such as a blackberry Bold.

However, I wrote an app that works great on ym blackberry curve (ver 4.2.2) but it isn't displaying the same on my boss's blackberry bold (ver 4.6).

On my phone, i have a custom ObjectListField that for each row, it displays 2 lines of text. However, on my bosses phone, it only displays the first line of text and the second line of text is hidden. Does "setRowHeight" not work in version 4.6?

What am I missing?


private class MyObjectListField extends ObjectListField {
        private Bitmap icon = Bitmap.getBitmapResource("img/document.png");

        // We are going to take care of drawing the item.
        public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width) {
                graphics.drawBitmap(1,y+3, icon.getWidth(), icon.getHeight(),icon,0,0);
                graphics.drawText(tickets[index].id, 18, y+3, DrawStyle.LEFT|DrawStyle.ELLIPSIS, 50);
                graphics.drawText(tickets[index].requestedDueDate, 18, y+getRowHeight()+2, DrawStyle.LEFT|DrawStyle.ELLIPSIS, 50);
                graphics.drawText(tickets[index].targetUser, 70, y+3, DrawStyle.LEFT|DrawStyle.ELLIPSIS, 150);
                graphics.drawText(tickets[index].assignedTo, 265, y+3, DrawStyle.RIGHT, 50);

                // the following line of next should be on the line below the text above
                graphics.drawText(tickets[index].description, 70, y+getRowHeight()+2, DrawStyle.ELLIPSIS, 245);
Old 08-24-2009, 02:08 PM   #2 (permalink)
Knows Where the Search Button Is
Join Date: Nov 2007
Model: 8830
Carrier: Sprint
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Welcome to J2ME

In my experience I've learned there are lots of subtle differences in the API between not only the OS revisions (4.2.2 vs 4.5+), but also between devices. This applies to other brand phones as well. Generally speaking the binary format of RIM's compiler output should be forwards compatible. In other words code compiled with RAPC, the RIM compiler, version 4.2.2 should load safely on a phone running OS 4.5. Load safely means you shouldn't get the critical verification errors and white screen of death when you run. However APIs can and do change so you always should code for the least common denominator and build in a fall back for exclusive features. Here's my favorite example. Streaming audio is broken in OS < 4.3. So if you build an app with a multimedia feature either code an alternative for 4.2- or a user message saying feature not supported. You should also be aware that cross the board compatibility is impossible as some devices, like the Storm, sport features that just aren't available on other devices.

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.