Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to implement a Java compiler and DEX converter into an Android app?
    primarykey
    data
    text
    <p>While trying to find an answer to <a href="https://stackoverflow.com/q/7085943/1482507">Android Jasper Reporting</a> I found out that there are two other questions to be answered therefor, which I been asked to ask as a question, not as an answer ;):</p> <p>My questions are now: "Is there any compiler to use directly on the device" AND "how to execute such without rooting the device. If anybody could give me a hint I would really appreciate it...</p> <hr> <p>I looked a little time forward on this approach, and found apps which makes it possible to create APKs directly on an Android device which is NOT rooted:<br></p> <ul> <li>TerminalIDE - <a href="https://play.google.com/store/apps/details?id=com.spartacusrex.spartacuside&amp;hl=de" rel="nofollow noreferrer">https://play.google.com/store/apps/details?id=com.spartacusrex.spartacuside&amp;hl=de</a></li> <li>JavaIDEdroid - <a href="http://code.google.com/p/java-ide-droid/" rel="nofollow noreferrer">http://code.google.com/p/java-ide-droid/</a></li> <li>AIDE - <a href="https://play.google.com/store/apps/details?id=com.aide.ui&amp;hl=en" rel="nofollow noreferrer">https://play.google.com/store/apps/details?id=com.aide.ui&amp;hl=en</a></li> </ul> <p>Looks like they're using the compiler from eclipse and a ported dex converter. Now I'm trying to figure out how to do the same.</p> <p>Sure: get the source code and look into it. But while I'm having curious problems to get a connection to the servers and trying to solve it, I follow the plea to ask this question here. Hoping both to help others with it and also getting an answer for myself ;)</p> <hr> <p>I took the org.eclipse.jdt.core_3.7.3.v20120119-1537.jar from the plugin directory of my indigo and tried following code:</p> <pre><code> org.eclipse.jdt.internal.compiler.batch.Main ecjMain = new org.eclipse.jdt.internal.compiler.batch.Main(new PrintWriter(System.out), new PrintWriter(System.err), false/*noSystemExit*/, null, progress); System.err.println("compiling..."); ecjMain.compile(new String[] {"-classpath", "/system/framework", storage.getAbsolutePath()+"/Test.java"}); ecjMain.compile(new String[] {storage.getAbsolutePath()+"/Test.java"}); System.err.println("compile succeeded!!!"); </code></pre> <p>Sometimes the Exception was thrown that java.lang.Object could not be found and othertimes it stuck doing nothing while heating up my processor with 100% usage ... ...</p> <p>At this time i could not figure out what is happening and why. And in cause that i have other work to do this part has to wait a little.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload