Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

java for different platforms

Thread view: 
whurc@iprimus.com.au - 19 Feb 2007 10:44 GMT
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
Boaz.Jan@gmail.com - 19 Feb 2007 12:03 GMT
On Feb 19, 12:44 pm, w...@iprimus.com.au 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
[quoted text clipped - 4 lines]
>
> 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
John - 20 Feb 2007 01:06 GMT
> On Feb 19, 12:44 pm, w...@iprimus.com.au wrote:
>
[quoted text clipped - 13 lines]
> 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
John - 20 Feb 2007 01:08 GMT
>> On Feb 19, 12:44 pm, w...@iprimus.com.au wrote:
>>
[quoted text clipped - 38 lines]
>
> JMTC

Stupid asterisks....

http://shorterlink.com/?WUMPTW
Arne Vajhøj - 20 Feb 2007 01:43 GMT
> 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
[quoted text clipped - 18 lines]
> on all platforms, and code to handle different operating systems, if the
> code is going to be used on multiple platforms.

It may have been news to you, but I do not think it is possible to
create a language with practical enough to be used for real world
programming which prevents programmers of writing non portable code.
If you can specify a filename you can use platform specific syntax
for that. The only thing a language can do is to give the programmer
the necessary tools to write platform independent code.

Arne

PS: System.getProperty( "line.separator" ) should not be used much -
    normally you would choose IO classes with builtin line support
    for reading or writing files with line structure.
John T - 20 Feb 2007 16:37 GMT
> It may have been news to you, but I do not think it is possible to
> create a language with practical enough to be used for real world
> programming which prevents programmers of writing non portable code.
Not sure what you are saying here...

Heres' an idea... what if the JVM were intelligent enough to take a command,
like say

String a = new String();
a="nnn";
a=a+os.NEW_LINE_CHARACTER;

and automatically convert the NEW_LINE_CHARACTER into the appropriate code
for the OS on which the JVM is running.

> PS: System.getProperty( "line.separator" ) should not be used much -
>     normally you would choose IO classes with builtin line support
>     for reading or writing files with line structure.

I've never actually used this myself, I was just quoting what someone else
said :-)
Arne Vajhøj - 21 Feb 2007 03:21 GMT
> Heres' an idea... what if the JVM were intelligent enough to take a command,
> like say
>
> String a = new String();
> a="nnn";

String a = "nnn";

would look much better.

> a=a+os.NEW_LINE_CHARACTER;
>
> and automatically convert the NEW_LINE_CHARACTER into the appropriate code
> for the OS on which the JVM is running.

It could.

Do you really think that:

a = a + os.NEW_LINE_CHARACTER;

is so much nicer than:

a = a + System.getProperty("line.separator");

?

Arne
a249@mailinator.com - 19 Feb 2007 19:34 GMT
On 19 Feb., 11:44, w...@iprimus.com.au wrote:
> I'm just getting started with java programming and would like to buy a PDA.

Java on PDAs, like Java on the desktop, is largely dead. Many PDA
producers no longer offer any kind of Java implementation for their
PDAs. Those who still have a Java VM usually haven't updated it in
years. ISVs offering VMs to individuals are largely unheared of, and
the few remaining ones who aren't alread bancrupt typically only sell
in bulk to companies.

What you can get are mobile phones with reasonable, up to date Java
VMs of the Java ME kind. If you want Java SE, you almost exclusively
get that on desktop and server computers with Window, Mac OS X
(typically some release behind), Linux, Solaris and other Unix
version.
Arne Vajhøj - 19 Feb 2007 21:16 GMT
> 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.

Java obvious does not care about Windows Mobile versus
Palm OS.

You should be aware that PDA's usually does not come with
J2ME and that J2ME implementations cost money.

If you can live with a non-J2ME compliant Java then
look at http://www.ewesoft.com/ !

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.