|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools...... |
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
|
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Sep 2005
|
I've been reading on the new mobile phones that are coming out, such as the Android. According to the specs, if a user wants to write their own application, they write it in Java. The Android itself runs on Linux, with the DVM (Dalvik Virtual Machine) running on top of that. [Up to this point, forgive me if I have explained something, or used some term, in error].
I have very limited experience in this kind of application software writing. Can anyone explain to me what a Virtual Machine is, and why a system would use one? I am more used to this kind of programming: "Write program in C code" --> compile --> "Assembly Code" --> 1's and 0's --> "Run on microcontroller" |
|
|
|
#2 |
|
diyAudio Moderator Emeritus
Join Date: Oct 2007
Location: Santa Cruz, California
|
It's a virtual machine because it only exists in software (sometimes only vaporware!)
It's what makes a combination of provessors, memory and convertors into a useful machine. On one level, it defines the machine for the hardware and software and creates a set of common interfaces which can then be connected to external nodes/resources like the cell phone radio, the keyboard/display and the speaker/mic. I'm sure others can expand/correct |
|
|
|
#3 |
|
Banned
|
Yeah right. It's a interface definition that an underlying hardware has to support. A Java VM provides certain facilities that a Java program may require. So now there are multiple processor types with various memory organizations and display facilities and input devices in Macs, Nettops and a whole slew of devices other than Windows PCs on all of which a Java program is going to expect to find an identical VM so that a piece of code meeting the definition 'Java' will run with comparable results on any of these items.
Obviously these VMs have to be created but this is in many instances less trouble than might be imagined, as the existing operating systems already provide diverse abstractions for many common computing functions. and consequently a VM running under Windows is probably identical regardless of whether the machine is Intel or AMD. OTOH a virtual machine in a mobile phone is much more likely to be hand-crafted to match the actual hardware. Code may be precompiled but is just as likely to interpreted. w Last edited by wakibaki; 28th December 2009 at 10:27 PM. |
|
|
|
#4 |
|
frugal-phile(tm)
diyAudio Moderator
|
A virtual machine is advantageous in that an ap written for said machine can be deployed on any platform that has software that creates that virtual machine. In this case Java. X11 is another.
dave
__________________
community sites t-linespeakers.org, frugal-horn.com, frugal-phile.com ........ commercial site planet10-HiFi p10-hifi forum here at diyA |
|
|
|
#5 |
|
diyAudio Member
Join Date: Dec 2009
Location: Md
|
Disadvantageous as it ties up more resources, and you have the possiblity of malware on more than one virtual host. OK, I am old-school. Just write the stinking app in assembly and let it rip. I am sick of waiting forever for my BD player to boot Java. Now my microwave has to boot. Phone? forget it. Oh yea, I forgot, it takes skill to code in assembly. Almost any fool can hack Java. Even me.
What VM's do really well is allow miss-behaving apps and bad code to exist within a single computer and not kill each other. Better to fix the code. |
|
|
|
#6 |
|
diyAudio Member
Join Date: Jan 2008
|
It's simply an abstraction layer that allows for the software to be largely independant of the hardware it's running on. This is handy, because it means that Android and all the apps for that platform (for instance) can be ported to x86, ARM or any other architecture that takes your fancy, simply by porting the Java virtual machine - work which has already been done for nearly every architecture.
The other advantage is in memory management - by abstracting the application from the RAM, the possibility of malicious code injection is significantly reduced. The downside is that it's slower, and adds the overhead of the virtual machine to the hardware requirements. EDIT: I should note that this process is pretty much entirely transparent to the end user - as far as you're concerned, you write the program in Java, compile it, and run it. It's just that it's compiled to Java Bytecode instead of Assembly, and runs in the VM rather than on the bare metal. |
|
|
|
#7 |
|
diyAudio Moderator Emeritus
Join Date: Oct 2007
Location: Santa Cruz, California
|
nicely put.
|
|
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Filter RF interference from mobile phones | joydivision | Chip Amps | 0 | 2nd October 2008 06:39 PM |
| how much DC through phones is okay? | cuibono | Everything Else | 2 | 20th April 2008 12:22 AM |
| Favorite cordless phones? | joe carrow | Everything Else | 15 | 18th April 2007 12:00 AM |
| New To Site? | Need Help? |