Help - Search - Members - Calendar
Full Version: What's The Lowest Common Denomiator For Java?
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Personal Java/Jeode/J2ME Personal Profile
TonyOlsen
Is it possible to write a Java application that will run on Desktops, Java Enabled PDAs, and Java Enabled Cell Phones, etc? (...including Java Enabled Toasters? wink.gif )

What do I write the Java Application in: Personal Java, J2ME, or something else?

(Everyday I become a little more disalusioned regarding the actual portability and backwards compatibility of Java. It isn't as portable as the hype said it was. Nevertheless, it is the best portability language I know of so far... or is there something better?)
Omicron
Java is not perfectly portable, it requires tweaking. But that is true for pre-java portable solutions as well.

The main reason for this is a deviation from the java Virtual machine spec or an abiguity of the spec itself.

As for lowest common denominator.....once you throw j2me into the mix, then pretty much j2me is the lowest common denominator and that can feel quite constraining.

However, it is important to realize that much of java is open source, or at least reproducable by googling. Much of java's "enhancements" were just code built on java that eventually got adopted as part of the language itself. So by googling for a part of java (like box layout) you can probbably find (a version of) the source code for it (in the public domain) and add it back into YOUR program.

Now this should only be done in extreme cases, but it is certainly a catch-all fallback that can be used to solve almost any problem.

The better solution is to do the research into J2ME and get comfortable in the confines of that language-subset. You can always break your code into a core processing package and then a j2me package (that has some limitations) and a full desktop package (that has lots of bells and wistles).

Just as the PDA's PIM application do not compare (in depth) to MS Outlook, nor should you Z version try to do everything your desktop version does.

J2ME is designed with the idea of a VERY resource constrained device in mind, so you need to start off small and keep an eye on processing power and resources used and constantly avoid lazy programming....which todays super-processors allow us ALL to do (myself included).

I hope this help to some extent. I believe J2ME is built from Java 1.14 or so, with some added limitations.

Sun is still working on getting J2ME right insofar as raising the bar on minimum resource (hardware) requirements without overdoing it (as they want to keep the 1.5 billion J2ME worldwide units growing and growing)...so they need to make the manufacturuers capable of producing cheap phones that meet the requirements.

The Zaurus has a LOT of processing power compared to many cell phones, but the newer ones are catching up (like the Treo,etc). You can also break out of the box yourself and make your own minimum requirements....nice thing is that eventually everyone will have the power of today's desktop in thier hands....we can only hope that the OS leaves us some crumbs of resources to use for applications.

O
PS(Another route if you know the hardware well, is to use the ocaassional native call to carry out processor intensive activities....now this is not grea java programming...but it IS part of the java spec, so it is not totally breaking the rule.....Heck SWT is completely built around that concept).
TonyOlsen
Thanks! =)

So, J2ME produces the most portable Java code? Are there any J2ME Java Compilers and/or IDE for the Zaurus (SL-C860)?

...and J2ME "should" run (with minor tweaks, but not with needing additional libraires or classes) on any Java VM? So, it doesn't matter which VM I have on my Zaurus while developing J2ME applications?

If that's the case, then which Java VM for the Zaurus is the best? Are there any Zaurus Java VMs that support the full J2SE (Java 2 Standard Edition) Java applications, including any of the many Java applications that are available today? There appear to be many VMs available and there's an inconsistant census as to which one is the best...
TonyOlsen
It appears from the Zaurus Java FAQ that the Zaurus DOES indeed support J2SE (because it has all of the needed extensions). (Can someone else read the link above and confirm that I understood it correctly?)

So... what are the different options for compiling Java Apps? What are the options/preferences for editors? How about VMs? Compare and Contrast...

Thanks, =)
stupkid
Tony,

I put all of this in another thread, but here it is again... A more accurate way to put it is that Java Personal Profile (J2ME) supports most of J2SE. You can read all the details here:

http://java.sun.com/products/personalprofile/index.jsp

To quote the J2ME PP specification:

"Personal Profile 1.0 is based upon J2ME Foundation Profile (JSR-46), version 1.0. Specifically, Personal Profile 1.0 includes Foundation Profile 1.0. It is also a superset of the J2ME Personal Basis Profile (JSR-129), version 1.0. With respect to APIs in the java.* packages, it is a subset of the Java 2 Platform, Standard Edition (J2SE), version 1.3.1. Applications written to these APIs in Personal Profile 1.0 are therefore upward-compatible to J2SE 1.3.1."

So, there are parts of the J2SE 1.3.1 in Java Personal Profile ( personal-profile-for-zaurus_1.0-fcs-b25_arm.ipk that comes with the c860), but there are no J2SE components in Personal Java (Jeode which came with the 5500 series for example). if you want to be the most compatible with everything look at coding to jdk 1.1.8 specifications.

Hope this helps.
trejkaz
I should add here since nobody seems to have mentioned it, that there really is no lowest common denominator here.

There are two strains of J2ME:
  • CLDC and MIDP are on one side, which is what pretty much all phones support.
  • CDC and PP are on the other side, which is what pretty much all PDAs (except for Palm) support. As has been mentioned, CDC and PP is basically a subset of J2SE.
The lowest common denominator, if you had to give one, would be CLDC. But CLDC has no GUI functionality at all, so isn't really suitable for anything except libraries and such.

On the GUI side, you're pretty much screwed. Any GUI classes you can use to make MIDP apps are not available in PP, and any GUI classes you can use to make PP apps are not available in MIDP. No lowest common denominator whatsoever.

It was actually for this reason that last year, I asked whether anyone knew of ways to run MIDP stuff inside PP (supposing that someone wrote a compatibility layer, it would be quite possible to do.) But since nobody answered and Google couldn't find it, I assume that such a thing doesn't exist.

If you want to support both sides then, you should design your application using an MVC paradigm to save work. Write an MIDP view, a PP view, and a single model which both views can use.
jamicheramie
Try me2se for MDIP support. Works for some programs.

QUOTE(trejkaz @ Feb 10 2005, 05:28 PM)
I should add here since nobody seems to have mentioned it, that there really is no lowest common denominator here.

There are two strains of J2ME:
  • CLDC and MIDP are on one side, which is what pretty much all phones support.
  • CDC and PP are on the other side, which is what pretty much all PDAs (except for Palm) support.  As has been mentioned, CDC and PP is basically a subset of J2SE.
The lowest common denominator, if you had to give one, would be CLDC.  But CLDC has no GUI functionality at all, so isn't really suitable for anything except libraries and such. 

On the GUI side, you're pretty much screwed.  Any GUI classes you can use to make MIDP apps are not available in PP, and any GUI classes you can use to make PP apps are not available in MIDP.  No lowest common denominator whatsoever.

It was actually for this reason that last year, I asked whether anyone knew of ways to run MIDP stuff inside PP (supposing that someone wrote a compatibility layer, it would be quite possible to do.)  But since nobody answered and Google couldn't find it, I assume that such a thing doesn't exist.

If you want to support both sides then, you should design your application using an MVC paradigm to save work.  Write an MIDP view, a PP view, and a single model which both views can use.
*
trejkaz
QUOTE(jamicheramie @ Feb 15 2005, 02:29 AM)
Try me2se for MDIP support. Works for some programs.


Yeah, it doesn't seem bad. Ran across that in my latest search.

Supports MIDP 1.0, but not MIDP 2.0. Currently evaluating the cost of wasting my time making it support some of MIDP 2.0. In particular, the ability to enter decimal numbers is extremely invaluable. The gaming API is lower on my wishlist.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.