4 ms·
Sounds good but suppose I need to make a network request on iOS. How would that work since there is no common Java library to do it on iOS as well as Android?
by thewarrior 12y ago
Sounds good but suppose I need to make a network request on iOS. How would that work since there is no common Java library to do it on iOS as well as Android?
If we're only going to write the very limited business logic in Java I don't really see the benefit.
- talloaktrees 12y agoFor something like that you can use RoboVM. It's a java bytecode (which means clojure, scala, et al are also usable) to native code compiler
- cromwellian 12y agoIf you only have trivial business logic, then yes, no benefit. But you can create common libraries that interface with native Cocoa frameworks. Google's new Inbox by Gmail was delivered on three platforms simultaneously. It was not written from scratch 3 times.
- thewarrior 12y agoIs there any way to use this to write the entire data handling layer ?
- ZitchDog 12y agoMy guess is you'd write j2objc wrappers around sqlite and HTTPUrlConnection/NSURLConnection and expose API for business logic elements. edit: here is an example: https://groups.google.com/forum/#!topic/j2objc-discuss/8u2Si-jvw6w https://groups.google.com/forum/#!topic/j2objc-discuss/8u2Si...
- duaneb 12y ago> It was not written from scratch 3 times. No, but did it also use java translation? That would involve writing wrappers for many of the native libraries. They would also have to do View/Controllers in objective-c (or some equivalent translator). And finally, they would have to special-case operating systems everywhere. This framework would not at all suffice to do multi-platform development; xamarin, robovm, cordova, and titanium all get much closer to this goal.