Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shared Library for iPhone and BlackBerry

I have a set of functionality (classes) that I would like to share with an application I'm building for the iPhone and for the Blackberry (Java). Does anyone have any best practices on doing this?

like image 489
Cody C Avatar asked Dec 22 '22 10:12

Cody C


1 Answers

This is not going to be possible as far as I understand your question - the binary format for the iPhone and Java are not compatible - and even for a native library on a blackberry device.

This is not like building for OS X where you can use Java unfornately the iPhone doesn't support Java.

The best idea is probably to build you library in Objective-C and then port it to Java which is an easier transition than going the other way. If you programme for Objective-C and make sure you code has no memory leaks - then the changes are not so complex.

If you keep the structure of your classes the same then you should find maintenance much simpler - fix a bug in the Java and you should find it easy to check for the same bug in the ObjC methods etc.

Hope this helps - sorry that it is not all good news.

like image 79
Grouchal Avatar answered Dec 24 '22 23:12

Grouchal