Why Choose Java for Android Development Over Other Languages?

  • Context: Java 
  • Thread starter Thread starter Alex_Sanders
  • Start date Start date
  • Tags Tags
    Java
Click For Summary

Discussion Overview

The discussion centers around the choice of Java for Android development compared to other programming languages. Participants explore the advantages and disadvantages of Java, its runtime efficiency, and the underlying architecture of the Android operating system.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Some participants suggest that Java's primary advantage is its ability to run the same code on any hardware due to the presence of a virtual machine.
  • Others argue that runtime efficiency is often irrelevant in many applications because modern hardware is sufficiently fast.
  • One participant raises concerns about the performance of Flash Player and its resource consumption, questioning the suitability of Java for video streaming.
  • Another participant clarifies that Android is based on Linux and primarily written in C and C++, with the SDK in Java, and notes that Android does not use a traditional Java Virtual Machine.
  • There is a claim that a well-architected Java application can outperform a poorly designed C++ application, highlighting the importance of programming quality over language choice.

Areas of Agreement / Disagreement

Participants express differing views on the advantages of Java for Android development, with some emphasizing its cross-platform capabilities and others questioning its efficiency, particularly in the context of video streaming. The discussion remains unresolved regarding the overall superiority of Java compared to other languages.

Contextual Notes

There are unresolved assumptions regarding the performance implications of using Java versus C/C++ in various contexts, as well as the specific architectural details of Android's execution environment.

Alex_Sanders
Messages
73
Reaction score
0
The Android system is an OS by java for java, but why? What significant advantage does java posses over other languages? Is it because high-end hardware are so cheap and numerous, that no one need to think about the runtime efficiency anymore? Or because google want to make money, and somehow consider java is somehow more developer-friendly comparing to others?
 
Technology news on Phys.org
The original reason for Java was to have a language where you could run the exact same code on any hardware. This is accomplished by having a 'virtual machine' on each hardware that runs the Java code. In answer to your question, there are many, many applications where run-time efficiency is irrelevant because the hardware is so fast. If I want to run a little piece of code on some web page, it doesn't matter whether the code takes 1 microsecond or 100 milliseconds to run, because in either case it happens instantaneously as far as the user is concerned. The important thing is that the code runs on whatever machine the user has and and doesn't crash.
 
phyzguy said:
The original reason for Java was to have a language where you could run the exact same code on any hardware. This is accomplished by having a 'virtual machine' on each hardware that runs the Java code. In answer to your question, there are many, many applications where run-time efficiency is irrelevant because the hardware is so fast. If I want to run a little piece of code on some web page, it doesn't matter whether the code takes 1 microsecond or 100 milliseconds to run, because in either case it happens instantaneously as far as the user is concerned. The important thing is that the code runs on whatever machine the user has and and doesn't crash.


How about flash player? Flv video stream? It's a nightmare even on desktop comps. Flash player, Plugin-container for Firefox especially, eats up tons of my hardware resources and yield no satisfying results. And they have been updating it every week or so.
 
I think video streaming needs to be fast so using Java is not an option. Getting software to run cleanly on the huge number of hardware platforms that are out there is not easy, which is why they keep updating it. I don't know the details.
 
Alex_Sanders said:
The Android system is an OS by java for java, but why?

No, it's not. Android is Linux - i.e. it's written mostly in C & C++.

The SDK is in Java. However, Android doesn't have a Java Virtual Machine. And it doesn't execute byte-code. It runs something called Dalvik - which I think is more like an executable than something regular java stuff.

Anyway, a good programmer can architect a Java based application which runs faster than a C++ one made by a bad programmer - Check out mailinator - http://mailinator.blogspot.in/2007/01/architecture-of-mailinator.html
 
Last edited:
Alex_Sanders said:
How about flash player? Flv video stream? It's a nightmare even on desktop comps. Flash player, Plugin-container for Firefox especially, eats up tons of my hardware resources and yield no satisfying results. And they have been updating it every week or so.

For exactly that reason I have disabled the plugin-container in about:config of my firefox. sorry for going off topic but i just cannot resist it. The plugin-container is really kind of slow for video.
 

Similar threads

Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
27
Views
13K
  • · Replies 21 ·
Replies
21
Views
4K
Replies
127
Views
23K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
Replies
4
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
8K