How to develop cross platform applications using Java
-
2*"As java is platform independent it will work on all mobile devices."* To my knowledge, the only phone that supports (a form of) Java is Android. Even that is not J2SE. – Andrew Thompson Jan 11 '13 at 05:32
-
You should remove this question, and post it on a more relevant one of the exchanges than stackoverflow. – Travis J Jan 11 '13 at 05:32
-
1@AndrewThompson: I think blackberry is Java-based, too (but very different from Android). – Thilo Jan 11 '13 at 05:33
-
@Thilo Does it run J2ME? I forgot J2ME. – Andrew Thompson Jan 11 '13 at 05:34
-
Probably. And something "native" which is maybe also Java. http://stackoverflow.com/questions/444431/develop-blackberry-apps-using-native-api-or-j2me – Thilo Jan 11 '13 at 05:35
-
@Thilo Thanks for the link. It is more complicated than my naive comment suggests. – Andrew Thompson Jan 11 '13 at 05:37
-
Java is far from the cross platform solution that it's advertised to be... especially for mobile devices. I recommend looking into [_Unity 3d_](http://unity3d.com/promo/unity4/?gclid=COLcl-jL37QCFQ3nnAodFXQAvA) if you want to make apps that run on Android AND iOS using the same code base. With Unity you can write once and run it on several platforms: Web, Windows, Mac, Android, iOS, Flash, PlayStation, Wii, XBox, etc... Unity rocks! – jahroy Jan 11 '13 at 05:37
-
3@AndrewThompson: Well, naive comment or not, the gist is that there is no write-once-run-anywhere Java for mobile phones. Not even close. – Thilo Jan 11 '13 at 05:39
-
*"Java is far from the cross platform solution that it's advertised to be..."* - I don't think you will find any advertizing that claims that Java runs on all platforms. The "write once, run anywhere" slogan *means* anywhere that supports Java SE. – Stephen C Jan 11 '13 at 05:49
-
"My concept is write once run everywhere." - Isn't that the concept of Java? – Niklas R Jan 11 '13 at 06:18
-
You can try this...http://developer.eclipsesource.com/tabris/ – user867662 Apr 03 '14 at 07:26
2 Answers
As java is platform independent it will work on all mobile devices. So I want to create an apllication in java and that should run on iOS, Android, blackberry and all moble Platforms.
This is based on a misconception. Java's claim of platform independence does not literally mean that Java will run on all platforms. There are probably thousands of platform types that don't and won't ever run Java.
It doesn't even mean that Java runs on all mobile devices.
There is no implementation of Java for iOS. IIRC, Apple expressly forbade / excluded it via their control of the Apple appstore.
There is no Java SE for any mobile devices because Oracle refuses to grant licenses ... to protect Java ME.
Blackberry, etc are Java ME, not Java SE. And in fact Java ME is fragmented due to different smart-phone manufacturers implementing different "profiles" of Java ME.
Android is not Java. Large parts of Java SE are not there, and the UI libraries are completely different.
In short, what you want to do is not realistic.
The "write once, run everywhere" slogan really only applies to Java SE implementations based on the Oracle / Sun codebase. And even then, there are caveats.

- 698,415
- 94
- 811
- 1,216
-
Despite this question being close to useless, I appreciate the time you took to answer it, because I actually did learn something. So thanks! – Chris Cirefice Oct 11 '13 at 18:55
This is a really misguided question, but I'll answer it in the spirit of furthering understanding, thought I fear it'll be closed before long. I hope the question is real on not mere trolling.
Java the "environment" not the language is platform independent. The Java environment contains the Java Virtual Machine and a set of standard libraries which hook to the specific real run time platform.
A Java application is platform independent in the sense that it will run in any platform for which a Java "environment" exists.
Java comes in various editions e.g Standard Edition (J2SE) meant to run on desktops.
There are J2SE builds for Windows, Linux and OS X so applications built for this environment will run on all these platforms.
There is a mobile edition of Java (J2ME) which allows applications to run in several different OSes used by feature phones (assuming they had the facilities needed by the application.) But this is because several different OSes for feature phones support J2ME**.
Alas this is not the case with the current generation of smart phones. There is no standard Java environment supported by all (or even one) of the major smart phone OSes.
So Java cannot be presently used for (smart phone) mobile platform independent applications.
** Not entirely true as each OS seems to have its J2ME implementation quirks but close enough.

- 8,707
- 2
- 42
- 50