Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Hi i'm planning on porting the javac compiler and dx converter to android..Is this going to be a trivial Task or are there any major Roadblocks?

My idea is to create an app so that people can compile java source code in the android devices and maybe even make android apps in the same android devices...

is this possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
183 views
Welcome To Ask or Share your Answers For Others

1 Answer

Most people would not consider it trivial.

You list javac and dx as things that need to be ported. Those are certainly requirements. You would need to create an ARM port of javac (and all the system libraries that it might use that are not on Android). You would also need to attempt to create a version of dx that would run on Dalvik VM, as it is written for the Java VM.

Beyond that, you would need to port, at minimum:

  • aapt and all the system libraries that it might use that are not on Android
  • aidl and all the system libraries that it might use that are not on Android
  • the LLVM compiler
  • Ant (written in Java, but for the Java VM and very likely will not run on the Dalvik VM without modifications)
  • the entire imported set of Ant tasks used by the build process (also written for the Java VM)
  • other Java SDK tools used by those Ant tasks as part of the build process (e.g., jarsigner, keytool)

And then you would need to create an Android app that could invoke the Ant task to do the build, bearing in mind that the Android shell is rather limited and could conceivably place its own impediments on this process. Such an app would need to capture stdout and stderr and report the results to the user (e.g., compile errors). You would likely also need to roll your own miniature IDE, unless there is an existing text editor sufficient for your needs.

I would estimate this as taking well in excess of 100 engineer-months. So, if your firm has tasked a nice-sized team for the project, you might have it done in a year or so.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...