I would like to create a java app that actually programaticlly compiles a differnt android project - Meaning i'd like to create .apk files by code. How would i go about this??? Is this feasible?
Thanks
-
If you want it to run on the Android device, I'd say it's not feasible. If you want it to run on a workstation (i.e., replicate Dalvik) it's feasible but why would you need it?antlersoft– antlersoft2011年11月21日 21:42:24 +00:00Commented Nov 21, 2011 at 21:42
-
No no, i mean compile a custom android package from a java "console application", Not on an android device.Menyh– Menyh2011年11月22日 06:52:46 +00:00Commented Nov 22, 2011 at 6:52
1 Answer 1
Sure, it could be done. If there is a way to build an Android project by command line, you can make those calls with Java I'm sure. See this and this link for information on building Android programs from the command line. From there, its simply invoking the correct commands in Java, maybe using Runtime.exec().
This will require a good understanding of the build process, and will most likely get very cumbersome. So an answer to your question as to whether or not it is feasible: no, it would be difficult.
You could use Ant to automate your build process.