I agree that it's a noble goal, but I'm curious about places where that sort of logic is actually common enough to justify the overhead of maintaining a cross-platform library.
Most of the applications on my phone are ultimately native UI skins over web services. There might be some logic in there to handle other features, but in most cases it's tied into OS-native features anyway.
I can see cross-platform libraries being useful for games using GL, maybe for media applications that require formats not supported by the OS, and for applications that do heavy image or audio processing – in short, the sort of thing where the value-add is specifically high-performance processing. Maybe that's enough to justify the existence of these tools, though I'd imagine it's almost always a better option to write your library in C in the first place.
Looking though a random sample of non-game apps on my iPad, I'd guess that about half would have a significant chunk of code which is not OS-specific, including: Gmail, Spotify, Anki, Google Maps, Facebook, Twitter, Penultimate.
I also don't think that the choice between C and Java as the common language is so clear cut. C would get you some speed benefit but Java has GWT for porting Java to Javascript, and and a huge range of other tools and libraries. In the end I think it would come down to how comfortable your development team was in each language.
(Disclaimer: I'm a Java developer)
You can compile C to JavaScript with emscripten[0].
See https://groups.google.com/forum/#!topic/j2objc-discuss/5lMZN...
The UI in JS is simple to develop, but you have a lack of performance also
If you combine j2objc and GWT together, you can share code between Web, native Android, and native iOS, while writing the UI in JS, Objective-C with InterfaceBuilder/Xcode, or native Android Views.
If you want to share non-UI code across all three platforms you have these kinds of choices:
* js everywhere (WebView wrapper or embedded JS interpreter on iOS) * C everywhere (emscripten/NaCl on WEB) * Java everywhere (GWT->js for Web, j2objc for iOS)
I can only speak from experience, but option three worked fantastically.