Google offers tool to bridge Android and iOS app dev
theregister.co.uk
theregister.co.uk
- People love to spout off about why Google does this or that. I guarantee you that the goal of this project is NOT to help "lazy developers" avoid learning Objective-C. Effective use of J2ObjC requires you to use Objective-C and Xcode.
- Many developers seem to think that application architectures from their particular domains of expertise are universal or most important. There are many apps for which "core business logic", and not UI code, dominates.
- Small-team/single-platform/large-team/multi-platform developers seem to have trouble imagining what it's like to be on the other side.
- Reading non-technical articles about a technical project that you've worked on is bizarre.
I then had to keep explaining to these developers that "in fact, to use this kind of bridge, you will need to be both an expert at Objective-C and an expert in Java, or you will likely run into some horrible semantic mismatch between how your code at the boundary operates and what the two runtimes each require"; it seems like the same is true of your J2ObjC (especially with regards to memory management).
One of the more common ways to share code between Android and iOS now is to have a library written in C/C++ which is linked via NDK on Android and wrapped in ObjC/ObjC++ on iOS. In an all plain-ARM world this is no big deal, but the more CPU types you add the more of a pain this becomes on the Android side despite some support in the SDK for "fat binaries" (you still have to anticipate and compile for all those arches, whereas Java/Dalvik code will "just work" regardless of underlying CPU).
Given Intel's recent push into Android along with the continued divergence of ARM into lots of branches with different features, different SIMD instructions, etc, this seems like a pretty useful solution to that problem.
Either way, this was a Summer of Code project. I doubt Google gave a ton of thought to how it fits into their overall global strategy for Android development as many bloggers seem to be theorizing about.
And with luajit's FFI support, it's almost a better C than C.
Objective C, the syntax, has very little value without Objective C runtime/standard library and Objective C runtime/stdlib is huge (compared to C and C++ standard libraries).
NDK has a very specific goal: if the code would be too slow when compiled to Dalvik VM, you can get speed with NDK, writing in C/C++, but at the cost of loosing access to almost all of the APIs that Android provides. This tradeoff more or less makes sense only for games.
Implementing Objective C runtime and standard library would be huge undertaking and the code, when used, would occupy more memory. Also, this code would mostly duplicate C++ standard library, just with a different syntax.
It doesn't make sense to allow people using Objective C in NDK.
Do you have any code you can share? Are there any resources in general I should check out?
I think you'd find a lot of interested for that. I'd appreciate it a lot.
The only thing missing is...the browser.
We're doing the same thing, but with JavaScript as the application code, and unique front-ends for HTML5 browsers, older browsers, Android, iOS, mobile browsers, etc.
It's trivial to get a JavaScript VM running on any given platform.
And also "If you'd like to join the bug hunt, the full source code for J2ObjC is available now under the Apache open source license"
"Google says J2ObjC works with most build tools, including Xcode and Make, and that the translation from Java to Objective-C is totally automated. No additional editing of the Objective-C source code output by the tool is necessary."
The proof is in the pudding. I guess I'll have to check it out.
Anything with a large backend is likely an intensive game, and aren't those cores written in native C/C++ anyway?.
Someone please take an app in Objective C, convert it to JS with route 66, convert to Java with (?) And convert back to Obj C with this tool, and share.
Where on earth did you get that number?
UI code in a well-structured application is a thin-shim on composed, testable backend code. It should be the least of the code, by far.
That and the demotion of native code in Android (native code there calls Java libraries) really make me question a lot of things.
We write a lot of Java at Google, but I wouldn't call anyone a "Java programmer". We're just programmers. And like all programmers, if we can save time by writing a tool and letting the computer do some work, we will. Laziness, impatience, hubris, and all that.
But some (most Java devs?) devs look like they are "only Java" right now.
This has to do with calling a single command and blasting out an app for IOS once you have already written an app for Android.
If you note carefully Google could have done it the other way around, by implementing IOS shims on top of Android.
This would have been easier (as Google controls Android) and because Objective C code is low level code that is easier to port to high level Java code.
And it would have given an incentive to those who have already written IOS apps to port them to Android.
So why not do it that way? Because then everybody would develop for IOS first and Android second and few people would use the Android specific features. By going from Android to IOS, Android is the primary system, but Google still lover the cost of development of Android apps by having the IOS market articficially subsidise it.
It is the classing Jole post (http://www.joelonsoftware.com/articles/StrategyLetterV.html) with the twist that Google is lower the price of the complements to its complements (ie. smart phones are complements to Google ads and apps are complements to smart phones).
I haven't built ICS apps, though, so perhaps it's getting better.
I've recently been diving into mobile dev and the short list of good options on having a common code base between the platforms seems so strange to me.
That's basically the reason for this. We have huge amounts of Java libraries, and we want to create and ship out features on 3 platforms simultaneously. Not having to write, say, an Operational Transform library 3 different times (JS, Java, and Objective-C) and keep them constantly in sync will go a long way.