Java as language and syntax is trivial and can be easily parsed and compiled.
Then there are the basics, which not technically part of Java are still the absolute minimum needed. Stuff like java.lang.Object, java.lang.Thread. Anything Java will assume at least basic versions of these to exist. Then things start diverging.
java.lang.Object on JME has only a few members while standard editions have more.
Android is mostly a legal mess. It's Java as one would expect, but since Google refused to play on Sun's and later Oracle's terms, it's sort of unofficial Java version. As such, anything goes. There are currently no applications that would make sense to run unmodified on both, desktop and android. The differences in functionality and interaction are simply too big and Swing/AWT/SWT have been stuck at around year 2000. So it's a non-issue. Android also doesn't strictly use a VM, Java code is compiled. That makes some full-blown Java functionality difficult or impossible to implement (run-time compilation or similar, somewhat common in enterprise app servers).
Benefits of using Java:
- programming model is identical. Listeners, patterns, methods, ... same everywhere
- idiot-proof. Java as language really is simple. It keeps you from getting distracted with various tweaks.
- GC and resource management behavior. The most radical, but also only one that completely avoids edge cases. These choices keep VM simple and at same time keep performance characteristics across platforms. Something slow on desktop will be slow in same way on phone and vice versa. In other languages the classes of bottlenecks vary greatly depending on hardware
As far as portability goes - the closer the device class, the better. Phones to phones is usually good, phone to desktop likely not. This applies to libraries only, not language or bytecode, those can alway be recompiled if needed.
Show differencesHistory of post edits
#1Antheus
Posted 24 January 2012 - 01:44 PM
Java as language and syntax is trivial and can be easily parsed and compiled.
Then there are the basics, which not technically part of Java are still the absolute minimum needed. Stuff like java.lang.Object, java.lang.Thread. Anything Java will assume at least basic versions of these to exist. Then things start diverging.
java.lang.Object on JME has only a few members while standard editions have more.
Android is mostly a legal mess. It's Java as one would expect, but since Google refused to play on Sun's and later Oracle's terms, it's sort of unofficial Java version. As such, anything goes. There are currently no applications that would make sense to run unmodified on both, desktop and android. The differences in functionality and interaction are simply too big and Swing/AWT/SWT have been stuck at around year 2000. So it's a non-issue.
Benefits of using Java:
- programming model is identical. Listeners, patterns, methods, ... same everywhere
- idiot-proof. Java as language really is simple. It keeps you from getting distracted with various tweaks.
- GC and resource management behavior. The most radical, but also only one that completely avoids edge cases. These choices keep VM simple and at same time keep performance characteristics across platforms. Something slow on desktop will be slow in same way on phone and vice versa. In other languages the classes of bottlenecks vary greatly depending on hardware
As far as portability goes - the closer the device class, the better. Phones to phones is usually good, phone to desktop likely not. This applies to libraries only, not language or bytecode, those can alway be recompiled if needed.
Then there are the basics, which not technically part of Java are still the absolute minimum needed. Stuff like java.lang.Object, java.lang.Thread. Anything Java will assume at least basic versions of these to exist. Then things start diverging.
java.lang.Object on JME has only a few members while standard editions have more.
Android is mostly a legal mess. It's Java as one would expect, but since Google refused to play on Sun's and later Oracle's terms, it's sort of unofficial Java version. As such, anything goes. There are currently no applications that would make sense to run unmodified on both, desktop and android. The differences in functionality and interaction are simply too big and Swing/AWT/SWT have been stuck at around year 2000. So it's a non-issue.
Benefits of using Java:
- programming model is identical. Listeners, patterns, methods, ... same everywhere
- idiot-proof. Java as language really is simple. It keeps you from getting distracted with various tweaks.
- GC and resource management behavior. The most radical, but also only one that completely avoids edge cases. These choices keep VM simple and at same time keep performance characteristics across platforms. Something slow on desktop will be slow in same way on phone and vice versa. In other languages the classes of bottlenecks vary greatly depending on hardware
As far as portability goes - the closer the device class, the better. Phones to phones is usually good, phone to desktop likely not. This applies to libraries only, not language or bytecode, those can alway be recompiled if needed.