Why does Android use Java? - Stack Overflow

 

java jdk for android phones

JRE on Android. Ask Question Asked 10 years, 8 or similar ARM processors running Android x, x, x, or , such as smart phones, tablets, other "hand-helds", home gateways, etc. The JRE4As targeted at devices based on x86, MIPS, and PowerPC processors running Android x, x, , or a subsequent release of Android would. Jul 27,  · How to create a 3D Terrain with Google Maps and height maps in Photoshop - 3D Map Generator Terrain - Duration: Orange Box Ceo 6,, views. Generally this is not possible as although Android-flavored java has the same syntax and semantics as typical java, it does not run on the same virtual machine (Google has its own VM that android phones all ship with and which has a different byte code format than conventional java VMs) nor does it use or have access to Oracle's java standard library.


OpenJDK: Mobile


By using our site, you acknowledge that you have read and understand our Cookie Policyjava jdk for android phones, Privacy Policyand our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information.

Even Android supports Native code applications, the main development tool is Java. But why? I mean, isn't it too slow to interpret code on a mobile device? This means, that using Java over native code is 2-x times slower.

Yes, I know that using managed code applications is safer in terms of system stability, since virtual machine has better control of program, but still, this performance drop is huge, and I don't see any point why to use it. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.

If this question can be reworded to fit the rules in the help centerplease edit the question. Security is even more important. The Android environment lets users run semi-trusted apps which could exploit the phone in truly unpleasant ways without excellent security. Java jdk for android phones running all apps in a virtual machine, you guarantee that no app can exploit the OS kernel unless there is a flaw in the VM implementation.

The VM implementation, in turn, is presumably small and has a small, well-defined security surface. Perhaps most important, when programs are compiled to code for a virtual machine, they do not have to be recompiled for new hardware. The market for phone chips is diverse and rapidly-changing, so that's a big deal.

Also, using Java makes it less likely that the apps people write will be java jdk for android phones themselves. No buffer-overruns, mistakes with pointers, etc Native code is not necessarily any faster than Java code. Where is your profile data showing that native code java jdk for android phones run faster? Java jdk for android phones runs java jdk for android phones many different hardware platforms.

You would need to compile and optimize your native code for each of these different platforms to see any real java jdk for android phones. Java has huge open source support, with many libraries and tools available to make developers life easier. Java protects java jdk for android phones from many of the problems inherent in native code, like memory leaks, bad pointer usage, etc.

Java allows them to create sandbox applications, and create a better security model so that one bad App can't take down your entire OS, java jdk for android phones. First of all, according to Google, Android doesn't use Java. That's why Oracle is suing Google. Oracle claims that Android infringes on some Java technology, but Google says it's Dalvik. Can you back up your performance conjecture with some actual benchmarks?

The scope of your presumptions don't seem justified given the inaccurate background information you provide. Java has a pretty compelling argument for Google using it java jdk for android phones Android: it has a huge base of developers. All these developers are kind of ready to develop for their mobile platform. As touched on elsewhere, the main issue is that Android is designed as a portable OS, to run on a wide variety of hardware.

It's also building on a framework and language familiar to many existing mobile developers. For most applications the overhead of using a VM-based language over native is not significant the bottleneck for apps consuming web services, like Twitter, is mostly networking. Given that almost all VMs JIT compile down to native code, raw code speed is often comparable with native speed.

A lot of delays attributed to higher-level languages are less to do with the VM overhead than other factors a complex object runtime, 'safety' checking memory access by doing bounds checking, etc.

Also remember that regardless of the language used to write an application, java jdk for android phones, a lot of the actual work is done in lower level APIs. The top level language is often just chaining API calls together.

There are, of course, many exceptions to this rule - games, audio and graphics apps that push the limits of phone hardware. First of all it's about the same thing will windows mobile or the iPhone, the. And even if the performance is not at the best, because it's an interpretation of byte code, android brings the entire java community as potential developers.

More applications, more clients, etc. To finish, no performance is not that bad, that's why java is used even on smaller devices see JavaMe. Learn more. First 10 Free. Why does Android use Java? Asked 9 years ago. Active 5 years ago. Viewed 91k times. OK, this should really be asked to someone from Google, but I just want other opinions. Neill B. Neill 3, 7 7 gold badges 38 38 silver badges 71 71 bronze badges.

Java code is not interpreted, at least not on Android -- it's compiled and ran on a virtual machine. I thought Sun proved Java can be in a few areas, but quite often nearly as fast as native code?

Plus, the google guys are a smart pack - I'm confident that the JIT they recently introduced will sooner or later produce very good code. This is done specifically because it is faster than native-code techniques, java jdk for android phones. To what extent this offsets the extra overhead will vary from app to app.

Running on a VM thus no recompiling is a huge plus. About the rogue application thing - this sounds interesting. Correct me if I am wrong, but x86 CPUs have biult in protection via paging and ring modes, therefore application cannot change its page in memory therefore cannot interfere with another app other than using OS API. I actually have no idea. Neill Aug 24 '10 at Memory protection is part of some cpu architectures. It prevents a malicious application from accessing memory assigned to a different application.

Falmarri: Yes, it does. Basically its very simple. Your app has assigned its own adress space. All adresses you want to access are translated by MMU. You want to access adress 0x and MMU translates it into for example 0x0E And to prevent you to change the base adress, its priviledged instruction and your program when started by OS has assigned lowest priviledge level. If not, single CLI disable interrupts instruction would crash system Neill Aug 25 '10 at On the byte-code level, Android doesn't use Java.

The source is Java, but it doesn't use a JVM. David Thornley David Thornley Java is the source, but its not compiled to java virtual machine compatible byte code.

They're only using the syntax of the language. It still has to support most functions of the java vm. So they can't optimize those out.

Then why the need to install the JDK when developing in android? Is it just for the emulator? The improvement to system stability is very important on a device like a cell phone. Why Java? There are a large number of developers already proficient in Java, java jdk for android phones. Cheryl Simon Cheryl Simon 42k 14 14 gold badges 85 85 silver badges 82 82 bronze badges.

Secondly, I haven't seen a Java byte code interpreter since Keep in mind that, technically speaking, Android does not use pure Java. Pablo Santa Cruz Pablo Santa Cruz k 29 29 gold badges silver badges bronze badges. I think that all the people interested in Mobile development are also interested in "cooler" languages than Java, java jdk for android phones. JulesLt JulesLt 1, 10 10 silver badges 9 9 bronze badges.

Colin Hebert Colin Hebert Featured on Meta. Linked 9. Related Hot Network Questions. Stack Overflow works best with JavaScript enabled.

 

2 Easy Ways to Get Java on Android (with Pictures)

 

java jdk for android phones

 

While most Android applications are written in Java-like language, there are some differences between the Java API and the Android API, and Android does not run Java bytecode by a traditional Java virtual machine (JVM), but instead by a Dalvik virtual machine in older versions of Android, and an Android Runtime (ART) in newer versions, that. Jul 27,  · How to create a 3D Terrain with Google Maps and height maps in Photoshop - 3D Map Generator Terrain - Duration: Orange Box Ceo 6,, views. Some PDAs (Blackberry, Palm), tablets (iPad, Android, Windows Surface RT), smart phones (iPhone, Android), gaming consoles (Nintendo Wii), MP3/MP4 players (iPod), and other personal mobile devices do not support the Java plug-in. See your device manufacturer's website to determine if Java is available for your specific device.