From: Gergely K. <ger...@ma...> - 2010-03-04 17:29:38
|
Hi Peter, 2010/3/4 Peter Carpenter <pet...@sk...> > Hi guys, > > > > Our company is looking at using xmlvm to cross-compile some java code to > objective c for use on the iphone. Our project is comms based and so using > lots of sockets, threads, parsing & others. I have to say, this looks like > a VERY useful product, however had some initial questions which I hope some > friendly people would be happy to answer to help guide our future path. > > > > 1/ On my initial conversion, I’ve discovered that a few interfaces like > “Cloneable”, “Enumerator”, and also the “Hashtable” class don’t seem to be > included in xmlvm. Is it simply a matter of generating obj-c code for these > classes or is it deeper than this & we’re better off modifying our java code > to not require these? > If you look at the patch we submitted: http://xmlvm-reviews.appspot.com/18002/show It implements a large part of Hashtable, java.util.Enumeration... etc. It also implements locking, and at least the HTTPConnection part of the network stack. We are in the process of updating this patch / breaking it up to ease the inclusion into XMLVM trunk. If there are standard Java APIs that you need, but are not implemented yet, you need to create the necessary classes in xmvlm2objc/compat-lib/objc. We currently don't use automatically cross-compiled implementations of the standard Java classes, although technically it should be feasible. In fact, the Android compatibility layer is cross-compiled from Java to ObjC. The reason we currently use hand-written ObjC classes is that we use ObjC categories to add the required Java compatibility layer to the regular Objective-C classes. This has the effect that a java_lang_String is just an NSString, with only a single method call indirection overhead for the Java methods. Object instances can be passed back and forth between the Java and ObjC worlds without any conversion. Also, for the collection framework we were able to just reuse NSArray, NSSet, NSDictionary for the different Java classes in a very similar manner. It did come up on the list before multiple times (e.g. the latest was last weekend) that XMLVM could support cross-compiled Java APIs, e.g. from Apache Harmony, at least until optimized versions are available. I did some experiments with it back in December, but at that time I decided that the amount of work to get it running was higher than the expected gain -- at least for our project. > 2/ Is there any further documentation/websites on getting up to speed with > the xmlvm code other than the manual? I’ve had a poke around and haven’t > found a great deal. > I don't know about too much documentation beside that. > 3/ How reliable/stable have people found cross-compilations from > java->objective c? Is it wise to proceed down this path for a commercial > application? > You should not expect this to be a seamless process. Most likely you will find that some machine instructions are missing, which you will have to add to the XSL (pretty straightforward to do). Then you will most likely run into missing methods in the Java libraries. In many cases there exists a native IPhone implementation for the same method/class, so one only needs to wrap it accordingly. And then of course there are bugs in the Java API implementations, which are of course fixed continuously, but still, don't expect the same stability as you are acustomed to in other Java platform. However, we are nearing the phase in our project, when we can submit it to the App Store for inclusion, so it is certainly usable, but you will most probably need to maintain a private branch with fixes and improvements to ensure the necessary stability. One issue is the commercial licensing / Linking Exception, which you will need to discuss with the XMLVM Core Team (they are listed on the website). Best Regards, Gergely > > > Regards, > > > > > > *Peter Carpenter* > > *Senior Developer* > > > > [image: cid:image001.gif@01CA6135.90C08EE0] > > > > (T) +61 3 9558 6088 > > (F) +61 3 9562 8886 > > *pet...@sk...* > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > -- Kis Gergely MattaKis Consulting Email: ger...@ma... Web: http://www.mattakis.com Phone: +36 70 408 1723 Fax: +36 27 998 622 |