These days, the biggest stumbling block to code sharing is that the BlackBerry VM and Android VM support different versions of the Java language. BlackBerry uses a subset of Java 1.3, Android uses a subset of Java 1.5. (Aside, no platform implements a Java virtual machine, both use their own virtual machines. Java is used as a programming language. Java bytecodes must be converted to the corresponding native VM format before they can run on the platform.)
The biggest difference that you will find as a library developer is that BlackBerry lacks the things that were introduced in 1.5, very important things like generics and enumerations. Worse, collection classes are missing from BlackBerry. This is sad, but it has been so for a long time.
This means that in order to be truly portable, you must write in the lowest common denominator, which means using (very) old-style classes such as Hashtable and Vector that do not have generics, folding your own listings (as in the first issue of Effective Java) etc.
Or you create two libraries, a modern version for Android and a truncated version (with just the bare stuff you need) for BlackBerry.
It's hard to say what suits you.
Eric giguere
source share