Is android linux or java

Android базируется на Linux, но что это значит?

Android, может быть, базируется на Linux, но он не базируется на том типе системы Linux, которую вы, вероятно, используете на вашем персональном компьютере. Вы не можете запускать приложения Android в типичных дистрибутивах Linux и вы не можете запускать программы Linux, с которыми вы знакомы, в системе Android.

Linux составляет ядро Android, но Google не добавил все типичное программное обеспечение и библиотеки, которые вы можете найти в дистрибутиве Linux, таком как Ubuntu. В этом все различия.

Сравниваем «Linux» и ядро Linux

Большая разница здесь сводится к тому, что мы подразумеваем под Linux. Люди используют термин «Linux» для обозначения многих различных вещей. По своей сути, Linux означает ядро Linux. Ядро является основной частью любой операционной системы.

Мы также ссылаемся на дистрибутивы Linux как просто «Linux». Тем не менее, дистрибутивы состоят не только из ядра Linux. Они содержат много других частей программного обеспечения, таких как утилиты командной оболочки GNU, графический сервер Xorg, рабочий стол GNOME, веб-браузер Firefox и так далее. Вот почему некоторые люди считают, что для «дистрибутивов», таких как Ubuntu, Mint, Debian, Fedora, Arch, OpenSUSE и другие, следует использовать термин GNU/Linux.

Android под капотом использует ядро Linux. Поскольку Linux имеет открытый исходный код, разработчики Android из компании Google имели возможность модифицировать ядро Linux под свои нужды. Linux предоставляет разработчикам Android для начала предварительно собранное и уже поддерживаемое ядро операционной системы с тем, чтобы им не нужно было писать свое собственное ядро. Это тот метот, с помощью которого было построено много различных устройств, например, в PlayStation 4 используется ядро FreeBSD с открытым исходным кодом, тогда как в Xbox Один использует ядро Windows NT, которое можно найти в современных версиях Windows.

Вы даже увидите версию ядра Linux, которая работает на вашем устройстве, в пункте меню About phone (О телефоне) или About tablet (О планшете) в меню Android’s Settings (Настройки Android).

Различия

Существует некоторая дискуссия по поводу того, можно ли квалифицировать Android как «дистрибутив Linux». В нем используется ядро Linux и другое программное обеспечение, но в него не входит большая часть программного обеспечения, которое обычно входит в Linux дистрибутивы.

Когда вы загружаете устройство с Android, ядро Linux загружается так же, как это было бы в дистрибутиве. Тем не менее, большая часть остального программного обеспечения различается. В Android не входит библиотека GNU C Library (glibc), используемая в стандартных дистрибутивах Linux, а также не входят все те библиотеки GNU, которые вы обнаружите в типичном дистрибутиве Linux. В нем также сервера X, например, Xorg, так что вы не сможете запустить стандартные графические приложения Linux.

Вместо того, чтобы запускать типичные приложения Linux, Android использует виртуальную машину Dalvik исключительно для того, чтобы запускать приложения, написанные на языке Java. Эти приложения ориентированы на устройства Android и интерфейсы прикладного программирования (API), которые представлены в Android, а не на Linux в целом.

Почему не удастся запустить в Android приложение, предназначенное для настольного компьютера с Linux

Поскольку в состав Android не входит графический X-сервер или все стандартные библиотеки GNU, вы не сможете просто запускать приложения Linux на Android. Вы должны запускать приложения, написанные специально для Android.

В Android есть командная оболочка, похожая на ту, что вы найдете на Linux. Но «прямо из коробки» нет способа получить к ней доступ, но вы можете установить приложение, например, Android Terminal Emulator, для того, чтобы получить доступ к этой терминальной среде.

Здесь, по умолчанию, вы не сможете сделать слишком многого. Терминал будет работать в ограниченной среде, поэтому вы не сможете получить полный доступ к корню системы без того, чтобы не выполнить рутование вашего устройства Android (прим.пер.: получить права доступа суперпользователя root). Многие стандартные команды, которые вам, возможно, потребуются, не доступны — вот почему те, кто выполнил рутование своих устройств в целом, устанавливают приложение BusyBox, устанавливающее много утилит командной строки. Эти утилиты используются приложениями, которым нужно что-либо делать с правами суперпользователя.

Читайте также:  Разбиение диска под линукс

Почему не удастся запустить программное обеспечение для Android на настольном компьютере с Linux

В состав Linux не входит виртуальная машина Dalvik, поэтому Linux не может запускать приложения Android. Виртуальная машина Dalvik и все другое программное обеспечение Android, нельзя просто поместить в настольный компьютер с Linux — например, вам придется сделать больше работы для того, чтобы приложения для Android выдавали результат в в окно на обычном рабочем столе через Xorg. Теоретически, если выполнить всю работу, разработчики могли бы сделать, чтобы Dalvik работал на настольном с Linux и пользователи настольных компьютеров с Linux могли запускать приложения Android на своих рабочих столах. Была сделана попытка создать приложение (теперь уже не работающее) для Ubuntu, которое пытались сделать что-то вроде этого, интегрируя Ubuntu и Android на телефоне и позволяющее сделать так, чтобы эти программы можно было запустить на рабочем столе Ubuntu.

Для ОС Windows и Mac была попытка сделать это с помощью эмулятора BlueStacks и других приложений Android. Они запускают Android в виртуальной среде на виртуальной машине, что позволяет им запускать приложения Android на рабочем столе с большой потерей производительности. Но эти решения оказались не очень популярными.

ОС Chrome, созданная Google, также базируется на Linux. Как и Android, ОС Chrome не предоставляет стандартную оконную систему X, поэтому стандартные приложения Linux не могут работать на ОС Chrome. В отличие от Android, ОС Chrome ближе к стандартным дистрибутивам Linux для настольных компьютеров, поэтому вы можете использовать режим разработчика для того, чтобы установить недостающее программное обеспечение, предназначенное для настольного Linux.

Источник

Android

Android is Linux (and Java)

In case you did not know, Android 2.1, �clair, runs on the 2.6.29 Linux kernel. However, the user space it is built atop Dalvik, a Google-designed custom JVM (Java virtual machine).

This is pretty interesting, when you think about it. The core of Android is the linux kernel, and the standard unix/linux shell exists and is easily accessible; however, user applications are Java-based.

I have read some news reports with some strong opinions about «pure Linux» or «pure Java» and issues with Android.

At The UNIX and Linux Forums, it has always been both our mission and policy to steer clear of any «religious wars» between the various flavors of unix and linux. We don’t even permit windows-bashing here!

All operating systems are equally of interest here, so if you are like me and interested in Unix and Linux, you are also interested in Android, because Android is Linux.

Making all this more interesting, of course, are all the predictions that Android will be the dominate mobile phone OS in a few years. This means there will be millions of more Linux users on the planet!

Speaking of SSH and Android.

There is a HOWTO on the net that describes how to install SSHD on Android so folks can SSH into their Android phone.

I may get around to that in a few months

Making all this more interesting, of course, are all the predictions that Android will be the dominate mobile phone OS in a few years. This means there will be millions of more Linux users on the planet!

Personally I prefer Nokia due to free licensing for commercial products using QT. But then, I’m more than likely a minority. I have no predictions, except that soon this little device we all carry around will do more and more crazy things like be able to program our household appliances etc. Act as a TV/DVD/Console game remote. Change our Air-Con temps. Start our cars (maybe not that one, would be painful loosing a phone, and then loosing a car as a result). Make phone calls, no wait it does that already. OK I’m out of ideas.

Читайте также:  Flash tool drivers windows 10

Well, I have had my first Android device for a few weeks now, a Samsung Galaxy S running Android 2.1, and since then, I have only turned on my Nokia phones to retrieve some stored data, LOL. I am not Google, I am a person who uses mobile access for just about everything possible and available, and I think Android is amazing on the Galaxy S. I plan to buy the Galaxy Tab as soon as I can, which I heard was October 22nd from Samsung yesterday, at a price of around $760 USD, around the same price I paid for the Galaxy S.

The main problem I have at the moment is that I have «retired» all my XP machines and am still using OSX PPC on the desktop, so I don’t have the right desktop platform to learn to develop some Android apps.

Funny, when I am on the subway, there are always people with many phones, generally over 1/2 are doing email or chatting on their mobiles. I have noticed that the iPhone users are quiet envious of my Galaxy S. The display is both bigger and brighter than iPhone.

That is cool, but more cool is that it is running a version of Linux called Android.

Источник

Can Linux apps be run in Android?

Android is based on Linux; can native Linux applications be run on Android?

15 Answers 15

In general, no. Android apps generally run in a sandboxed Java-like virtual machine, so have to be written in Java or some language that compiles to virtual-machine bytecode that use the Android API.

However, the virtual machine does run on top of the underlying Linux OS, and there are ways to call native code. See https://developer.android.com/tools/sdk/ndk/index.html

So, while it is technically possible to run native Linux programs, as there is a Linux kernel running beneath everything, most users would not be able to install such applications or use them. (If you have root access or are building your own firmware, then you can do whatever you want.)

Yes you can. I have installed a complete Debian distribution in a chroot-jail enviroment using debootstrap. (You need a rooted device) I am now running ssh, apache, mysql, php and even a samba server under android on my htc-desire with no problems. It is possible to run x applications using a remote x server via ssh. It even runs openoffice.org and firefox. You can use this: http://code.google.com/p/android-xserver/ to run X-application on localhost but my HTC-desire has a to small screen to be productive 🙂 But it might be usefull on a Eee Pad Transformer or something like that.

Android does not run X Windows, nor does it have many of the standard GNU libraries. So, since most native linux applications require one or both of these, most will not run.

In addition, even Java programs can be limited, because the version of Java that Android applications are written in is a subset of the standard Java library.

Not directly, no. Android’s C runtime library, bionic, is not binary compatible with the GNU libc, which most Linux distributions use.

You can always try to recompile your binaries for Android and pray.

The old link is dead it was for a Debian install script There is an app for that in the android market but you will need root

android only use linux kernel, that means the GNU tool chain like gcc as are not implemented in android, so if you want run a linux app in android, you need recompile it with google’s tool chain( NDK ).

I think this article can provide a solution : Linux Today — Compile, Install and Run Linux apps on Android
Hope it helps.

Читайте также:  Обновление яндекс браузера для windows 10

You can get an ARM cross compiler that runs on Linux here. You can also download the Android NDK and compile some command line apps. I do not have any personal experience with using C++ with either solution, but I have compiled a few simple things with both. It is my understanding that the NDK is not a full C++ compiler as there have been complaints that it will not compile some common C++ code.

Note that since I am a new user, I cannot post the NDK link. :/

yes i have done that on several rooted machines i set a debian linux on a sdcard by dd. i copy this script http://jeanmichel.gens.free.fr/etc/install on /system/bin

i have not yet succeed to run a Xserver but i can use xwindows binaries through the android Xserver application

i can run update my debian with apt-get upgrade , run an apache server with PHP , run a ssh server and all binaries on a terminal including user management i have also a problem with semaphores handling please contact me if you have any trouble

Yes they can if they’re compiled under an arm linux first or using a cross compiler. Debian arm versatile works, there’s also arm-eabi for compiling under x86 linux to arm linux.

Yes, they can. If you do not have a rooted phone/tablet, then you could download c4droid here to compile your apps. Then, you could download Kevin Boone’s KBOX here to run the program.

Hell, of course yes, with several limitations.

Android is a kinda special Linux distribution, with no usual suff like X11, and you can’t install Apache2 with apt-get. But if you have ARM cross-compiler, you can copy your ELF files to the device, and run it from a terminal app or if you have installed some SSHD app, you can even use SSH from your desktop/notebook to access the Android device.

To copy and launch a native Linux executable, you have not root your device. That’s the point, where I am, I’ve compiled my own tiny webserver to Android (and also for webOS), it runs, hallelujah.

There comes the issues, which I can’t answer:

My tiny webserver use only stdlib and pthreads. I have no idea how to use the (native Linux) libraries comes with Android, there are useful ones, altough, I can live without them.

Now I can launch my app from a terminal app by hand. But I don’t know, what’s the best way of deploying such native apps to Android. I think I should be write a small Android app, which launches the server and not letting automatically stopped by the system (say, as like music players never killed). Also, if its a service, it should somehow started on boot. I’m not familiar with Android.

Short answer, no. Long answer, you can run Linux application if you install some software.

To avoid rooting your device, you can try the GnuRoot and XSDL combo to get a minimal chrooted environment, (Actually, it use proot to enable a rootless chrooted jail), or get the Debian Noroot application, which combine the former two application in a single virtual machine environment. Both can be fetch from Google Play.

However, there is a few drawbacks: first, the X11 Server bundled by XSDL and DNR is a compatibility layer wrapped around a Android port of SDL library and SurfaceFlinger. This means, hardware accelerated OpenGL graphics are not avaliable, and even the sound support requires some hacks. So, the author choose a simple Desktop Environment: XFCE4 suitable to low memmory and no 3D support. The second problem is the incompatibility from the DNR Virtual Machine of direct hardware acess, since it requires real root privileges. So you can’t burn DVD, print using USB cables. even the author’s projects may promise a workaround in a future. Finally, this solution enables to install user-space programs like LibreOffice, Gimp, Samba. not kernel-space modules.

Even with this limitations, the DNR is a very powerfull program.

Источник

Оцените статью