Re: java for different platforms



John wrote:
Boaz.Jan@xxxxxxxxx wrote:

On Feb 19, 12:44 pm, w...@xxxxxxxxxxxxxx wrote:

I'm just getting started with java programming and would like to buy a
PDA. If anyone could please help me with some advice, I would like to
write some applications for a PDA. Which operating system is easier to
write java code for, windows mobile 5 or palm os and what api docs
would i need to use. I am using Jcreater at the moment as guided from
the book Beginning programming with java for dummies.

Wayne



the entire thing about java is that it doesnt matter what OS you're
using...
the code is the same. "write once run anywhere".
read the j2me tutorial at java.sun.com
or get a j2me book
j2me = java 2 mobile edition

Without desiring to start a debate (as my posts sometimes do) I think that "write once run anywhere" is not 100% accurate. A better wording should be "write once *correctly*, run anywhere". For example, in the past couple of weeks, there was a rather interesting discussion thread in c.l.j.h which talked about the difference in the way newline characters were coded in Java. As it turns out, different operating systems handle this differently. Andrew Thompson pointed out

System.getProperty( "line.separator" );

*Here is the actual link: http://shorterlink.com/?WUMPTW*

which is something that I didn't know about.

So, a java program coded on Windows with the windows system of dealing with newlines will crap out on Linux or other platforms which deal with it differently unless it is coded correctly by consulting the System.getProperty method. For a newbie like me, this was a very important thing to realize. If one is to write code that is truly portable, one must never assume that something is handled the same way on all platforms, and code to handle different operating systems, if the code is going to be used on multiple platforms.

JMTC


Stupid asterisks....

http://shorterlink.com/?WUMPTW

.



Relevant Pages

  • Re: java for different platforms
    ... write some applications for a PDA. ... the book Beginning programming with java for dummies. ... a java program coded on Windows with the windows system of dealing with newlines will crap out on Linux or other platforms which deal with it differently unless it is coded correctly by consulting the System.getProperty method. ... If one is to write code that is truly portable, one must never assume that something is handled the same way on all platforms, and code to handle different operating systems, if the code is going to be used on multiple platforms. ...
    (comp.lang.java.programmer)
  • Re: Microsoft Java almost gone in Vista
    ... software business and operating systems. ... which uses a subset of Java ... code to generate JavaScript to run on browsers without the need for a JVM? ...
    (comp.lang.java.programmer)
  • Re: [OT] Point of wiping in-memory keys?
    ... >>> Modern operating systems zero pages (or sometimes, ... a Java VM is not an operating system. ... services to share the same memory across multiple VMs. ...
    (sci.crypt)
  • Re: Petersons Algorithm in java, sequencial instruction execution ?
    ... I also found on an other book (operating systems) that Peterson's ... solutions is not garanteed to work since some hardware platform ... the JLS is a contract. ... The Java compiler and JVM can do all ...
    (comp.lang.java.programmer)
  • Re: Why buy a MAC and not a PC?
    ... I've been exclusively using Windows/Intel platforms so far, and have been OK with it. ... their early versions, although I believe these to be marginal, quite honestly, as UNIX-based operating systems already run on Intel platforms successfully. ... Anything else would be an unnatural break in the workflow. ...
    (comp.sys.mac.advocacy)