views:

49

answers:

1

Can we use j2me packages in android development? I just mean to say like for eg: sax parser is supported in both the platforms. So can we code the business logic in j2me platform and use that class in android platforms and vice-versa?

Just like this other components which are common in both platforms?

A: 

It would be possible to this for all the classes that do not depend on any of the classes/interfaces that come with Java-me or Android.

But you have to be sure to restrict all your business logic classes to comply with the JRE 1.3 specifications. That means that you need to set your compiler level to 1.3. This means that you for example can not use Generics inside your business logic (There are more things missing then generics but this is the one big thing that come to my mind right now).

Janusz
Also, have fun with Vectors instead of ArrayLists!
benvd
Hm the javadocs say that the arraylist is included http://download.oracle.com/javase/1.3/docs/api/index.html?java/util/ArrayList.html without generics. Is this java-me specific that the collections are not the same as in java 1.3?
Janusz
CDC has ArrayLists, but CLDC doesn't. (http://download.oracle.com/javame/)
benvd