java移植安卓,移植的javac和DX到Android

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?

解决方案

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值