12-23-2009 12:16 PM
Our team works on BB application which is oriented on a wide set of supported devices. It should support devices with OS version 4.2 - 5.0. We decided to use API of v4.2 OS. Then our application would be supported by all newer devices. It was successful way till the recent time. Problems arose when we started to use navigationMovement() function to handle movement event. This function works fine on devices with track-ball and it doesn't work on touch-screen devices. On touch-screen devices we should override touchEvent() function.
When we added touchEvent function to our project then the project couldn't be started on devices with OS < v4.7 (Error starting application: Class 'net.rim.device.api.ui.TouchEvent' not found). So I think we should split our project in two branches: the first will support touch screens and the second one will not. There will be two shortcomings in this approach:
1. We'll have to watch over corrections in two projects. It can happened that one branch was updated and the second one was missed (was forgotten for example).
2. Instead one binary we'll have two binaries. But it simpler to have one binary which will work on all desired platforms.
So please give me an advice how should we update our project to make him working on TouchScreen and non-touchScreen devices.
Development software which we use: JDE 4.2 and JDE 4.7.
Solved! Go to Solution.
12-23-2009 12:42 PM
If you are manipulating focus movement using navigationMovement and you wish to do similar processing using the Touch Events, then in my opinion, you have no choice, you will need separate binaries.
I've thought about this a little, here are two options I considered:
1) abstract the Fields into some classes that you package in a separate project/cod, then have a cod for trackball devices that uses n and one for TouchScreen devices. Then the rest of your application remains the same, As an example, say you create a MyField Class, then everything can derive from that - in the 4.7 version MyField will use Touch Events, in the 4.2 version it uses navigationMovement.
2) have your Ui Processing in a separate project/cod for OS 4.7 and OS 4.2, so just branch the UI cod
However neither of these really excited me, so I use the preprocessor, have one source, and do two builds.
I'm sure there are better ways, just I couldn't think of any.
This or related issues are discussed a number of times on the forum, have a search around.
12-23-2009 12:42 PM
02-18-2010 02:49 AM
We were facing the same problem. so we decided to use //#preprocess
we are using JDE 4.7 and we can build for all OS 4.2 > .
We are using same source code for Touch and Non Touch.
May be this could be another solution.
Thanks and Regards,
Ashish