Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am currently investigating different alternatives for building a mobile instant messaging application for iOS and Android, using an XMPP server (probably ejabberd) as the back-end. Main requirements are a nice UI and of course good performance on most devices.

I have identified three different alternatives, two of which include using the Marmalade SDK

Option A): Use Marmalade C++, creating the UI with Marmalade Libraries such as IwNUI/INUI. In this option, the UI is created in C++ code. My assumption is that this should be good in performance, however I am not sure how easy it is to achieve a nice, custom UI that has a good/modern feel to it, such as other high-quality apps. Another advantage: This would target iOS/Android with one code base.

Option B): Also Marmalade, using the C++ s3eWebView api to load local web pages packaged in the application package. UI would be designed in these web pages using HTML/CSS/JavaScript. For the application logic, JavaScript or C++ can be used, as there is a JavaScript Bridge (http://docs.madewithmarmalade.com/display/MD/The+Javascript+interface) to communicate between C++ and JavaScript code. Would also target iOS/Android in one go.

Option C): Non-Marmalade: Go with two code bases. Use Objective-C (i.e. "standard way") for iOS, and Google Android SDK for Android. Build the app twice.

I am currently leaning towards Option B, as this would allow for use of one code base, and leverage existing HTML5/CSS/JavaScript technologies (nice especially for UI), together with the ability to use C++. However, my concern is whether device/UI responsiveness will be acceptable with this. I have run some preliminary tests for simple things such as loading CSS3 dropdown menus into an s3eWebView via C++, and this seems fairly responsive (i.e. menu drops down quickly and smoothly).

share|improve this question
    
what language/technology you should learn next, including which technology is better is explicitly off-topic per help center –  gnat 2 days ago
    
I understand that, however I was referred to try this here from meta.stackoverflow.com/questions/251822/…. Is there no place on StackExchange one can ask such questions? –  user2606742 2 days ago
    
Is there no place on StackExchange one can ask such questions? I've read several FAQs and threads including meta.stackoverflow.com/questions/251822/…, meta.stackoverflow.com/questions/269983/…, meta.stackoverflow.com/questions/254567/…, and I can't find any resource where one can ask these questions and expect answers with a quality as high as usual at StackExchange –  user2606742 2 days ago
    
comments there look anything but referring to Programmers: "Your question does not look appropriate for programmers" –  gnat 2 days ago
2  
@user2606742 - performance is too broad of a term to provide a basis of comparison. Do you mean device responsiveness; network performance; relative android vs. iOS performance; etc... You have demonstrated that you've done your research with the backing technologies. You need to scope your question down so it is answerable. –  GlenH7 2 days ago

2 Answers 2

up vote 0 down vote accepted

Regarding the code:

C++ is already commonly used cross platform for non UI code, there was a recent presentation on how dropbox accomplishes this:

http://oleb.net/blog/2014/05/how-dropbox-uses-cplusplus-cross-platform-development/

Since you intend on using C++, the non-UI code can be shared regardless of the UI decision. That might make it easier to just make a decision about the UI.


Regarding the UI:

You should determine whether this tradeoff is acceptable with additional research.

The last mile of making a hybrid app mimic a native app is rarely worth putting effort into, as you will two problems: 1) finishing the app features, 2) hacking in all kinds of native functionality.

If you try apps made with mobile uis (this site[1]), apps made with mobile frameworks (ionic[2], ratchet[3], others...) and decide the performance is fine, then make a hybrid app. If you feel you need to improve on it, even incrementally, just ship native controls instead.

Even if you end up intending on shipping native controls, you could prototype with HTML and later figure out the native UI, assuming that the non-UI code is decoupled.

[1] http://blog.stackoverflow.com/2011/07/mobile-stack-exchange/

[2] http://ionicframework.com/

[3] http://goratchet.com/

share|improve this answer
    
thanks for these suggestions, I will have a look at them. I also think prototyping with HTML would definitely be an option. –  user2606742 yesterday

What do you prefer, using a single codebase for multiple platforms, or fully merge with each platform design requirements and features? Directly use the performance of a native application or deal with the webkit speed and limitations (compared to fully native code)? In my opinion:

A) I haven't tried Marmalade, so I don't know about the performance or anything related IwNUI, but if both interfaces are designed the same way, it may look weird to see interface decisions typical from iOS in Android and viceversa.

B) Similar to A, but with the lack of performance. HTML is easy, yes, but this means adding another layer to application execution. I have tried Cordova and there's no real way you can truly match a native app, neither performance nor design.

C) Do you know Android and iOS enough to code both of them? If you only know one of these two, do that app, monetize and get paid help from one that knows.

If you want to boost a sigle codebase, go for C++ (Android has NDK, and I guess you can do it your way with iOS too, maybe Marmalade would be enough), but make sure to give true differences to each interface. Otherwise, it may look a poorly designed interface in one of the platforms (or maybe both, if you want to take design decisions from both)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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