4 ms·
The author completely devastates their core point when they say- "Now I've told you why Android's use of a Java-like VM was demonstrably wrong (Apple demonstra
by ergo98 16y ago
The author completely devastates their core point when they say-
"Now I've told you why Android's use of a Java-like VM was demonstrably wrong (Apple demonstrated it) from the beginning"
What was demonstrated, the author claims, was that Android chose "Java" for security, where the iPhone demonstrates that native can be secure.
But...Android didn't choose Java for security. You have the full ability to use native code in your apps, courtesy of the NDK, and of course Android runs apps in an isolated process (using the inherent security functionality of Linux). Apps can't stomp on the system or walk outside of the lines and allowances granted them, Dalvik engine or not.
While you still need a Java main, you can build almost all of your app in the NDK if you really want to. But being pragmatic, 99% of most apps are comprised of a light veneer over the SDK (itself usually high-performance native), and in such cases native or not makes absolutely no practical difference. Where you need to go native for specific cases, go native.
So why, then, does Android use Dalvik? Probably because they intend for the platform to be usable on a heterogeneous array of platforms -- you can run Android on your PC, for instance, and upcoming smartphones may feature the Intel Moorsetown x86 mobile processor. By encouraging Dalvik, the platform, specifically the application portfolio, is freed from being tied to a specific processor architecture. The author tries to diffuse this obvious advantage by saying that such a change is "just a recompile away", but that is simply absurd -- when the first Moorestown phone comes out, off the bat it will be able to run the majority of market apps with no change at all, including those that used the NDK (as the Android norm is to conditionally load native modules, using a managed fallback if it isn't appropriate).
This is all ignoring that Android has a far more granular, and I would say robust, security system than the iPhone: recall that the iPhone is where someone got an app that ostensibly was a "flashlight" app, but in actuality was a tethering app, which absolutely demolishes any illusions that the review process is any sort of security check. But that isn't necessarily a part of the managed/unmanaged argument (because it has been shown that is a misdirection to begin with).
- deleted 16y ago[deleted]
- Tichy 16y agoI thought the NDK just interfaces to the Android Java API, so there would still be a lot of Java code in your app?
- ergo98 16y agoThe primary API was provided in Java, so yes from the NDK for many needs you have to step back to Java-world momentarily. This is a simply a limit of time however (given that Dalvik was their primary app runtime for other reasons) -- Google has been pushing more and more functionality directly to the NDK (e.g. 2.2 gives you the ability to fully use OpenGL from native code). However that is neither here nor there. You have the full ability to fall to native, to go hog wild with memory references and uninitialized pointers and stack overflows and trying to break free of the box you are placed within (the process boundaries). You have the ability to include C code from other projects for codecs and processing, etc.