Here is my situation. I am using a custom programming language thats syntax is based on Java. In order to compile this *.custom file I use the java classpath to locate the .jar that contains the .class files. This converts the .custom to .java from there I compile down to Java Byte Code and run on JVM. Now I am looking to use this custom language on Android. Is there a way that I can incorporate a .custom file into android and compile into .java and then to Dalvik Byte Code to run? Looking for any suggestions to run .custom on Android Thanks
Asked
Active
Viewed 87 times
1
-
1The Android dev tools are ultimately operating on Java `.class` files. If you can compile your code into something that will run on the JVM with the class-library restrictions of Android, you can compile the `.class` into a `.dex`. Keep in mind that you'll need to be referring to the Android API in your programs so the Android installer can link them to the Android runtime. – chrylis -cautiouslyoptimistic- Sep 07 '13 at 18:10
-
@Chrylis that should be an answer. – Antimony Sep 07 '13 at 19:05
2 Answers
1
The Android dev tools are ultimately operating on Java .class
files. If you can compile your code into something that will run on the JVM with the class-library restrictions of Android, you can compile the .class
into a .dex
. Keep in mind that you'll need to be referring to the Android API in your programs so the Android installer can link them to the Android runtime.

chrylis -cautiouslyoptimistic-
- 75,269
- 21
- 115
- 152
-
So if I compile into the class files and then convert to dex and run on Android it should ideally work? My question is how would I initiate the main() in the class file from the onCreate? – user2757520 Sep 07 '13 at 19:25
-
You would have to use the same lifecycle as anything else in Android; you use the manifest and Android entry points, not CLI Java `main`. – chrylis -cautiouslyoptimistic- Sep 07 '13 at 19:26
0
You can either compile to .class
and then convert that to .dex
using the dx
tool. Or you can use DexMaker to go right to .dex
from source.

Jesse Wilson
- 39,078
- 8
- 121
- 128
-
Ok, i was able to successfully convert a "HelloWorld" function from .custom to dex. Now how do i go about loading the dex file in a android app? – user2757520 Sep 07 '13 at 23:22
-