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
SUMMARY

Java is the primary language for Android development due to its platform independence, achieved through the use of the Dalvik virtual machine, which allows Java code to run on various hardware without crashing. The discussion highlights that while runtime efficiency may be less critical on modern hardware, Java's architecture enables developers to create robust applications. The Android SDK is primarily written in Java, but it operates differently than traditional Java environments, emphasizing the importance of understanding these distinctions for effective Android development.

PREREQUISITES
  • Understanding of Android SDK and its components
  • Familiarity with Java programming language
  • Knowledge of Dalvik virtual machine and its functionality
  • Basic concepts of cross-platform development
NEXT STEPS
  • Research the differences between Dalvik and traditional Java Virtual Machines
  • Explore best practices for optimizing Java applications on Android
  • Learn about the architecture of Android applications and how to leverage it
  • Investigate performance comparison between Java and C++ in mobile applications
USEFUL FOR

Android developers, software architects, and anyone interested in understanding the advantages of Java for mobile application development.

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
3K
Replies
127
Views
22K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
Replies
4
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
8K