From: Gergely K. <ger...@ma...> - 2009-11-27 02:39:33
|
Hi, We are porting a fairly complex J2ME / Android application to IPhone using XMLVM, and I had an idea to speed up the process. Instead of implementing every necessary class from the Java Runtime by hand, I pulled in the Apache Harmony runtime implementation from the Android platform and got to the point where it compiles to Java Bytecode. Now XMLVM happily produces cross-compiled Objective C code from it, but of course there are a number of native methods that need to be implemented. XMLVM treats native methods simply as abstract methods. The idea is to change the XSL, so it generates a dummy body for the native methods, probably throwing an UnsupportedOperationException() or something similar. Then for those classes that are actually used by us, we can go ahead and implement the native methods using the nice "Categories" feature of Objective-C, without the need to touch the generated source code. Of course, we plan to use the hand optimized versions of those classes that are available. For low-level classes, like threads, we plan to implement the Thread class directly using NSThread. But there are many classes, that are seldom used (exceptions) or are only interfaces, or simply they are not yet available in a hand optimized version. In these cases we are able to fall back to the cross-compiled version. What do you think? Would you be interested in this solution? Best Regards, Gergely -- Kis Gergely MattaKis Consulting Email: ger...@ma... Web: http://www.mattakis.com Phone: +36 70 408 1723 |