0

I'd like to do some Apps for Android tablets but the only language I can find that can be used is Java and it doesn't support the data types that I need (mainly complex numbers).

Even worse, it doesn't even appear to support operator overloading, so I can't even create a pseudo data type.

I have decades worth of scientific and mathematical algorithms with thousands of complex equations that I would like to move over to Android but the compiler is a real sticking point.

I reckon it would be quicker for me to modify the compiler than it would be to try and unravel the equations and convert them to reverse polish suitable for function calls.

I know the sources for Android itself are available but is the compiler ?

4

3 回答 3

4

If you mean the Dalvik engine, I think that's not open source. But regarding your actual problem, you can always use Android's NDK to use native code languages such as C or C++.

于 2012-10-29T08:06:40.073 回答
3

Android 是完全开源的,包括它的 JVM 引擎 Dalvik。

但是,尝试更改编译器或 JVM 不会让您有任何收获——您根本无法更改目前在数百万 Android 设备上运行的内容。

现在,如果您想创建可以在数百万台设备上运行的软件,您别无选择,只能调整您的软件。如果您需要处理复数,唯一成功的方法是创建您自己的 Complex 类库并更改您的其他数字库以使用它。

于 2012-10-29T08:19:51.357 回答
2

您将无法执行此操作,因为 Java 是一种解释和编译语言,并且解释器在设备上运行。因此,即使您确实修改了编译器以添加您需要的内容,您运行的任何设备都不会知道发生了什么。

相反,您可以:

  1. 使用支持 C 和 C++的Android NDK
  2. 修改您的算法以在 Java 中工作

另外,请记住,Android 使用Dalvik VM,而不是 Java VM,虽然它是开源的,但如果不编写自定义 ROM,您将无法将修改推送到目标设备。

于 2012-10-29T08:09:26.950 回答