Can you run java on Android?

474    Asked by AlisonKelly in Java , Asked on Oct 10, 2022

I know some 'normal' Java (computer Java), and I want to run such a program on my Android device. Is this possible? If yes, how?


Answered by Asutosh Jha

The answer to your question - Can you run java on Android - 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 bytecode format than conventional java VMs) nor does it use or have access to Oracle's java standard library. Google reimplemented most of the important elements (e.g. Google has its own implementation of HashMap, ArrayList, etc.) and ditched a lot of other stuff (e.g. there's no swing package in Google's library).




Your Answer

Interviews

Parent Categories