Saturday, September 15, 2012

Re: [android-developers] General question about Android architechture

Your post is somewhat uninformed for a number of reasons:

- this isn't an official Google forum for Android.
- there are other more appropriate places for your question:
android-platform, for example
- Being able to build a computer == being able to modify a 50 million
line operating system? Sorry, I don't see that comparison.
- why Java? Fits the VM architectural model.
- Dalvik doesn't obviate the security architecture of the linux
kernel, it works together with it. Most of the security benefits in
Android are *indeed* from linux itself!
- You seem to think that the VM is slow. This is a common claim, but
do you really know? Dalvik as an interpreter was pretty damn good,
when it got JIT capabilities it became even faster, so much of the
code executing *is* native code.
- The fact that the NDK exists is an indication that Java isn't the
best? What are you talking about? Every successful high level
language has a way to talk to lower level code: Haskell, OCaml, etc..,
Does that mean it's slow / wrong? No, it just means that sometimes
you need a lower level of control you can't get from the langauge. Am
I saying that Dalvik will kill it for custom graphics code? No, but
that's why the NDK exists: to handle the very small percent of times
when you *really do* need native code that controls low level
hardware.
- The cross platform decision wasn't really the sole reason Android
settled on Java, I would wager it was the fact that it is simpler to
write in than C++, just my blind guess.
- The OS isn't implemented on Java, much of the higher level stuff
is, and lots of time is actually spent in systems level code anyway...
- Unsure if you were around, but the NDK isn't new, it's been around
since Java :-)

The architect surrounding the VM and the choice of Java isn't
specific. In fact, calling it a *Java* virtual machine is just plain
wrong. What runs on Android is Dalvik bytecode. It's not quite the
same, it's a register rather than stack based virtual machine, and
there are some other differences as well. The way the VM is built
allows the platform to be architected a certain way, via forking a
zygote process and getting tons of common memory.

You're asking some questions that seem to imply Android is *bad*, but
you don't really have much support for those claims. Certainly
Android is *different* than Objective C, but the claims as to why it's
"worse" are somewhat unfounded here...

This video is old, but still relevant to help clear up some of your confusion:

http://www.youtube.com/watch?v=ptjedOZEXPM

And remember, this forum isn't for discussion of the OS design, and
Google employees probably won't answer you :-). You could try
android-platform, but I'd think about these points before you reask
your question!

kris

On Fri, Sep 14, 2012 at 9:11 PM, jamb <joshua.baldus@gmail.com> wrote:
> Hello Android devs!
>
> I recently bought a Motorola Razr Maxx, and then shortly after an Asus
> Transformer Infinity TF700T.... I suppose it goes without saying that I like
> the idea behind Android as an OS. But I'm a little curious about the
> architecture decisions, and thought this would be the best place to ask....
> As far as I know this is the only "official" Google forum for Android OS.
>
> As someone who has always built my own PCs from scratch, I have a pretty
> decent idea about hardware architecture. While I run Windows as my main OS,
> I've experimented with Linux and BSD on occasion (with mixed and often
> disappointing results, due to the hardware I choose). I'm no stranger to
> digging into the OS and tweaking as I see fit. So after grabbing the Android
> SDK and digging more into the architecture, one huge question is baffling
> me....
>
> Why Java?
>
> If my understanding of Apple products is accurate, iOS is based on FreeBSD
> with Apple specific hardware drivers and Cocoa. It's my understanding that
> Cocoa is a native set of classes that function in a similar way as GTK+ or
> QT, but developed "in-house" at Apple.
>
> So why did Google choose to implement Android as a barebones Linux Kernel,
> with phone/tablet specific drivers and a Java VM? Linux already has a
> fantastic security model, which (in my opinion) reduces the benefit of a
> sandboxed (virtual machine) environment. And a virtual machine, by
> definition cannot possibly perform as well as native code - even if it IS a
> hand optimized version.
>
> In deciding to use Java as it's primary application architecture, it appears
> to me that Google crippled Android from the get go. The fact that the NDK
> exists at all is a good indication that Java was not the ideal solution.
>
> C/C++ has always been a relatively robust language to design cross-platform
> applications - with some effort and preprocessor directives. Java is
> definitely _more_ portable, but who uses Android apps, but Android users? I
> just don't see that Java was the best way to implement an OS. Embedded
> developers design software for 2 platforms: iOS and Android. Using Java as
> the primary architecture forces developers to do far more than include
> different preprocessor directives and libraries - apps have to be redesigned
> from the start, even using NDK. In fact NDK is kind of a joke - using a VM
> to execute native code within it's context - of course there's no
> performance increase, though there's a huge increase in complexity!
>
> So why didn't Google choose a similar route as Apple? Creating a framework
> like Cocoa based on a Linux kernel (and using native c/c++ code)?
>
> If I'm off in left left or simply missing some major point, I'm more than
> happy to learn!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate