Shaon Hasan
Shaon Hasan

Reputation: 740

Android relationship with linux

If android uses linux, than how does it run on windows machine for development? I understand that android uses java byte codes and converts them to Dalvik byte code. So, I need java to write android codes. But where is the part of linux?

Here I have got a picture of android stack, where there are the layers defined. So, same questions how is linux related and in which stage I do my programming? Picture of android stack

Upvotes: 3

Views: 2047

Answers (3)

Alexander
Alexander

Reputation: 48272

Most often an Android program is written completely in Java and you do not have to think about Linux. However, you can include in your Android program some C/C++ code. That C++ code can make use of POSIX Linux API as well as of native Android API. If you write such code you will see more Linux.

Another way to see Linux is to use adb shell command from platform-tools directory. It will give you a Linux prompt and all those cd, ls and other Linux command.

Upvotes: 1

James Holderness
James Holderness

Reputation: 23001

When you run the Android emulator, you're actually running a virtual machine that completely emulates the ARM processor of a typical mobile phone. It includes a copy of the Android Linux kernel, Dalkvik VM, etc.

From the Android docs:

The Android system images available through the Android SDK Manager contain code for the Android Linux kernel, the native libraries, the Dalvik VM, and the various Android packages (such as the Android framework and preinstalled applications). The emulator provides dynamic binary translation of device machine code to the OS and processor architecture of your development machine.

Upvotes: 3

Alan B
Alan B

Reputation: 4288

Because the SDK is platform-independent, and you deploy to either a real Android device, or a virtual Android device running on an emulator.

Upvotes: 0

Related Questions