• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2ME and portability

 
Archana Reddy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jonathan,
Just one more dumb question ! I'am really curious.
How portable are these J2ME applications? Can an app written for Nokia 3410 cell phone run on a Sony Clie PDA easily or does it involve any more additional steps apart from installing the application on the target device.
regards,
Archana
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the whole point of any Java application. Theoretically you can compile a program once and install it anywhere. The same is true for J2ME. In fact, this is the main reason why most features are very limited. You are unable to make Palm OS or any other system calls. This is the price you pay for the portability, but often it can be worth it.
To reiterate, you can write a J2ME program that will run on any platform that has a JVM installed. (Note: Midlets must be converted to PRC files in order to install to Palm-based devices. The midlet code itself is exactly the same as for any other device, though.)
 
Jonathan Knudsen
Author
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, they're supposed to be directly portable, so anything you write that complies with the MIDP specification should run on any MIDP phone. In reality, there are implementation differences and outright bugs. I hear a lot of complaints from developers who are having trouble running an application on multiple devices.
However, the alternative (writing native and porting to each different platform) seems even worse. I think that's the secret to MIDP's success, that it's easier to tweak a MIDlet to run on multiple devices than it is to port a native application.
 
Sara Jahan
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jonathan Knudsen:
Well, they're supposed to be directly portable, so anything you write that complies with the MIDP specification should run on any MIDP phone.

Then why should a developer be downloading SDK from the company's Web site to which the phone, PDA etc he is developing for belongs? I guess the companies do provide some additional APIs speciafically focussing their phones.
/Sara
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been exploring the Palm SDK recently. One advantage is that if you are programming just for Palm-based PDAs and not any other portable devices, you can write smaller programs. Also, you don't need to install the J2ME virtual machine to run a program. This isn't an issue on devices that have the JVM embedded in the hardware, but it can be an issue on Palm-based devices where it isn't. Additionally, the Palm OS is more specific than the MIDP API. The generality of J2ME means that some device-specific features are not available. Sometimes these advantages outweigh the advantage of portability that you gain from MIDP. There are probably other reasons as well, but that's all I can come up with off the top of my head.
Layne
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you do Palm-only, SuperWaba might be a much better choice than J2ME.
Again, I am very disappointed by the J2ME support from Palm. I started learning J2ME on a Palm VII but has abandoned it a long time ago.
The best J2ME VM for Palm is IBM J9 (Websphere Micro environment -- the official name). But it is heavily customized for IBM specific tasks (e.g. support for DB2 Evereyplace etc.)
 
Burk Hufnagel
Ranch Hand
Posts: 814
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody have a clue as to why Palm hasn't already jumped on the J2ME bandwagon? Seems like a slam dunk - I just don't get it.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably because they would rather you develop with the Palm API. Of course, that might be shooting themselves in the foot since applications written for other platforms are more difficult to convert to Palm API compared to J2ME developers who are targeting other platforms and then tweaking it to work with Palm devices. (I sure hope that makes sense.)
As I mentioned earlier, Palm API is quite powerful to build small, specific apps for Palm devices. Of course, you pay with portability issues. As always, there are trade-offs between native and generic APIs. I'm a strong believer in understanding the trade-offs so that you can pick the "best" tool for the current programming project.
 
Jonathan Knudsen
Author
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, there was an announcement from Palm right around JavaOne that they were licensing IBM's JVM and would be packaging it (and MIDP, I think, but not sure if was 1.0 or 2.0) with the Tungsten T. As you can tell, I'm a little sketchy on the details, but you can probably look it up if you want more information.
 
Burk Hufnagel
Ranch Hand
Posts: 814
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Layne,
I've tried writing apps in C using the Palm SDK and I must say I prefer Java - I know it's slower and more limited than accessing the PalmOS directly, but I just hate giving up all the things Java gives me.
Perhaps I'm being foolish, but I would rather not go back... You have a Very Good point about using the right tool for the job, but I'm not willing to give up on Java for the Palm just yet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic