7

I am currently doing the preliminary design for a new product my company will be pushing out soon. We will start on Android, but then we will need to quickly develop the IPhone, IPad.... and then the Windows 8 ports of the application.

Basically the only code that wouldn't be reusable is the view specific code and the multimedia functions. This will be an SIP client (of course the user of the app will not know this) with several bells and whistles for our own business specific purposes.

My initial thought is to develop all of the engine in C and provide a nice API for the C library since JAVA and .NET will allow native invoking, and I should just be able to directly link to the C lib in objective-C.

Is there a better approach for vast code reuse which also remains close to the native platform? I.e. I don't want dependencies such as Mono-droid and the like or complicated interpreter/translator schemes.

I don't mind re-coding the view(s) for each platform, but I do not want to have multiple versions of the main engine. Also, if I want to have some good abstraction mechanisms (like I would in say, C++) is this possible? I have read that C++ is not allowed for the IPad and Iphone devices.

I would love to handle the media decoding in the C library, but I assume that this will be platform dependent so that probably will not be an option either. Any ideas here?

17
  • 3
    I don't want dependencies such as Mono-droid -- That's too bad. It's probably the most promising approach for your objectives. Commented Oct 25, 2012 at 16:52
  • 1
    I have been looking at PhoneGap to build a single thin mobile app that will compile across mobile platforms. I planned on utilizing REST based web services and maintaining nearly all business logic at the server, with only the need for views and presentation logic at the mobile side.
    – maple_shaft
    Commented Oct 25, 2012 at 16:56
  • 1
    @JonathanHenson I love OSS, but when my ass is on the line, I want complete control over the vital business functionality. Suit yourself but most of us aren't writing systems of such high importance that this absurd amount of low level control is necessary. C as a language is rarely necessary and difficult for just anybody off the street to maintain. Smarter business decisions are ones where architectural decisions are made that take advantage of well solved issues to save development time and reduce complexity while maintaining low coupling. It sounds as if you want best of both worlds.
    – maple_shaft
    Commented Oct 25, 2012 at 17:12
  • 2
    @JonathanHenson I can respect this mindset, but again avoiding the third party dependency for well solved problems is only a good idea when your solution directly seeks to compete with the third party dependency in its exact same problem domain. This leaves you as the developer to have more time to address actual business concerns rather than interesting technical challenges (unless of course the interesting technical challenge IS your business concern).
    – maple_shaft
    Commented Oct 25, 2012 at 17:27
  • 2
    developer.apple.com/technologies/ios says it does have C++ compilers for native development.
    – weston
    Commented Oct 25, 2012 at 17:37

3 Answers 3

3

Since you are approaching for SIP client, and for the same PJSIP is providing a great library for using SIP feature at client end.

I have also implemented similar application, and for the same, I have create a C code which was handling all my objectives. And then as per iOS and Android platform for background tasks handling and for providing all the native UI implementation, I have done native app development in Objective-C and Java respectively.

Then in iOS, there is no problem for using C code, and for Android I have used JNI-integration.

1

I would look into Apache Cordova (was phonegap) which allows you a cross-platform HTML5/js based GUI. The interesting part to me was that all the code is packaged into the client rather than be run as a client/webserver model (though, obviously you can still talk to a network server for data). I know a HTML5 gui isn't going to be quite as snappy as a native one, but performance isn't a major concern for most GUIs unless you have specific requirements like gaming.

For access to your crosss-platform C API, Cordova allows you to write a plugin to call the native code.

0

Adobe's been doing work in cross-compiling ActionScript for different phone platforms. I'm Pretty sure Flash can compile down to Android and iOS now, as well as AIR (which might get you Windows Phone); I'm not sure how well this will work for SIP protocol-wise, but I'd think it'd support media pretty well. (But then I've not done any development in this area.) The Flash player has limited system access but I hear AIR's support is a lot better, so you might be able to use some decent libs.

Edit:

AIR app for Android

AIR app for iOS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.