Linux - MobileThis forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Basicly what I want to do is use my mobile phone the same way I use my laptop. Compile and test codes,install same programmes and use terminal ,etc.
So I thought about installing linux in my phone.but knowing that an android kernel might have device specific code or something. Can I build linux system on android kernel and be able to use it the same way as my laptop ??
Also without losing functionality as calls,GPS,WiFi and so ??
To get stuff compiled, you need
A libc (of which you probably have just the running bits, not the development bits)
kernel headers
a compiler like gcc or llvm
ram to spare
disk space to spare
some programs instead of tiny little busybox pretending to be those programs
root access
excellent eyesight and patience in bucketloads.
and you probably have none of them except disk space. If you want to do that sort of stuff, best to start with an arm based distro (debian, fedora and I think slackware do them - perhaps others as well). Loads of howtos up on the web on this stuff. You can even be root there, and dual boot a phone with an ordinary distro (which will have the requisite bits). Howtos on the web. Or you could buy a raspberry Pi in case anything happens to your phone!!
You're better off developing on the Android Eclipse IDE but on PC. On your mobile you can indeed use a terminal and even install some programs without root.
Even if there is a way, compiling and testing code on a phone would be difficult even with a big one like the Note2.
I have a stock ASUS Transformer Prime, which is an android tablet with optional keyboard. Occasionally I will use "Terminal IDE" which is a fantastic app for command line editing and compiling. It can handle Java very easily, but the instructions for getting C code to compile were fairly involved so I didnt bother. Another good one is AIDE where you can edit, compile, and deploy a full android app directly on the device without needing a computer.
Even those options arent anything like a full linux gcc though.
Do your development on a system suited to software development, such as a PC running Linux. You can get cross toolchains for any architecture you're likely to find supporting Android.
--- rod.
Good question, worth asking.
At one time, java was touted as a write once run everywhere product. You'd never have to recompile an app for a different OS. Android is sort of a java as I understand it so I am not sure why one couldn't reverse it so that your phone app is easily run under some java on the computer. It may be there but I haven't seen it.
Just look in for xda developers on the google in reference to your query..you might want to check them out for your requirement. They have a real simple method of doing that..but be cautious of any damage whatsoever..it is not a completely safe process..
In reality, it's very dependent on the kernel itself and the device's capabilities. The following suggestions assume you have already obtained root access to your device; if not, you will need to do so.
The easiest way to do this is probably via a chroot environment. There's an app on the Play Store that will do this, called Complete Linux Installer; it works by creating a disk image file on your SD card (or internal storage), mounting it as a loopback device, and running your non-Android Linux on it. However, it's somewhat limited; expanding storage space is a pain, and there are some performance implications if you use that approach (since it involves lots of tiny operations on one giant file). It also requires your kernel to be built with loopback support; I've found this is usually the case for Samsung devices, as well as for CyanogenMod in general, but it's something to keep in mind if something fails.
There's also the possibility of ripping out the Android kernel and shoving it into a custom-brewed ARM distro. This is much harder, and will require a very firm understanding of the Android boot process. However, this is the approach encouraged by the Firefox OS folks for porting Boot2Gecko to new devices - basically, finding a CyanogenMod port, ripping out the kernel, shoving it into B2G, and seeing if it crashes and burns when it tries to boot/run.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.