diff --git a/LDP/inprogress/Linux-Android-HOWTO.sgml b/LDP/inprogress/Linux-Android-HOWTO.sgml index a2f93cb4..eb0e410c 100644 --- a/LDP/inprogress/Linux-Android-HOWTO.sgml +++ b/LDP/inprogress/Linux-Android-HOWTO.sgml @@ -4,7 +4,7 @@ Linux and Android HOWTO Guido Gonzato, Ph.D. guido.gonzato at gmail.com -October 2015, version 0.0 +March 2016, version 0.0 This HOWTO provides information on how to manage your Android device @@ -29,9 +29,9 @@ widespread Linux distribution, even though most of its users don't even know they're using Linux!

-(A pocket-size Unix system for less than 100 bucks. Amazing! If they'd -told me about it in the early '90s, I would have dismissed it as cheap -science fiction.) +(A pocket-size Unix system that one can get for less than 100 bucks. +Amazing! If they'd told me about it in the early '90s, I would have +dismissed it as cheap science fiction.)

I purchased an Android phone and a mid-spec Android tablet, and I @@ -65,7 +65,7 @@ root permissions, as you would do in Linux with sudo. Since Android is very fragmented (hey, it's Linux after all!) and several versions are available, I'll just provide information that is -applicable to what I own: Android 4.0.4 and 4.1.1, on ARM +applicable to what I own: Android 4.0.4, 4.1.1, and 5.0.1 on ARM architecture. All examples and code in this HOWTO were actually tested on my devices; hopefully, they should work on your device too. If you want me to cover more Android versions, I'll be glad to receive new @@ -167,7 +167,8 @@ least with the following options: Before using the adb commands, you must make your Andbox visible to the Linux box. Enable USB debugging on your device and connect it via USB cable to your Linux host; the Andbox will probably -make a sound and/or flash the screen. Issue this command: +make a sound and/or flash the screen and/or ask for your permission. +Issue this command: @@ -181,9 +182,9 @@ List of devices attached

If you don't see any output after ``List of devices attached'', or if -a row of ? is displayed, some steps and some patience are required to -make your device visible. First of all, find out your device's Vendor -ID and Product ID: +a row of `?' is displayed, some steps and some patience are +required to make your device visible. First of all, find out your +device's Vendor ID and Product ID: @@ -420,7 +421,8 @@ VFAT; directory names are therefore case-insensitive. programs' user data. Each directory is named after the application, using a naming convention that will be explained in Section . - For example, Firefox settings are in org.mozilla.firefox/. + For example, Firefox settings are stored in + org.mozilla.firefox/. Download/ may contain files downloaded by browsers, unless they're configured otherwise. @@ -639,15 +641,15 @@ If your device refuses to send a .apk file via Bluetooth, just rename or zip it before sending it, then unpack it or rename it back on the new device. - + Copying files

Exchanging files between Linux and Android should be trivial, right? -Well, it's not: read on. There are several ways to copy files from/to -your Andbox, using a cable or Wi-Fi. +Well, it's not. There are several ways to copy files from/to your +Andbox, using a cable or Wi-Fi. @@ -1113,9 +1115,12 @@ KBOX: it's a very good compromise. Installing KBOX

-Even though the latest version is KBOX3, I installed KBOX2, as my -Andboxes have an old-ish Android version. Installing KBOX3 is very -similar. +Whether to install KBOX2 or KBOX3 depends on your Andbox' Android +version. I installed KBOX2 on two of my Andboxes, which run Android +4.*, and KBOX3 on my new phone. In the following, I'll show how to +install KBOX2; installing KBOX3 is very similar. Try KBOX3 first; if +you get a segmentation fault running the KBOX3 installer, then try +with KBOX2.

Download the base installer, called kbox2-base-installer or @@ -1145,10 +1150,9 @@ KBOX shell is /data/data/jackpal.androidterm/app_HOME/kbox2/bin/kbox_shell

-(If you get a segmentation fault running the KBOX3 installer, then try -with KBOX2). If installation succeeds, you can replace the standard -Android shell with KBOX's. Open the Terminal Emulator preferences, -select ``Command line'', and change: +If installation succeeds, you can replace the standard Android shell +with KBOX's. Open the Terminal Emulator preferences, select ``Command +line'', and change:

/system/bin/sh - @@ -1182,13 +1186,19 @@ provided by Busybox. If you want to access the Android file system, you'll find it under the /android_root directory.

-You may want to install additional software from KBOX home page: +You may want to install additional software from KBOX home page. +Depending on your KBOX version, either link:

+

+ +

Additional programs are provided as .deb packages. This is the very same format used by Debian and many other Linux @@ -1298,7 +1308,7 @@ used instead of the command-line ftp client.

In addition to local shells, you can open a shell on your device remotely, via ssh; you will need a ssh server on the -Andbox. Such server is SSHelper: +Andbox. Such server is SSHelper (free software, GPL'ed):

/data/local/tmp. Unlike the deleted at boot time.

-Here is how to copy and run your application on the Andbox: +Here is how to copy (all Android versions) and run (Android older than +5.*) your application on the Andbox: @@ -1426,6 +1437,25 @@ Linux:~$ _ +

+Beware: Android 5.* has better security policies and will not allow +running programs from /data/local/tmp, or even accessing that +directory. From the terminal, you'll have to copy the compiled +programs elsewhere. For instance, using KBOX: + + + +kbox$ ls /android_root/data/local/tmp +ls: cannot open directory /android_root/data/local/tmp: permission denied +kbox$ cp /android_root/data/local/tmp/hello . +kbox$ ls +hello +kbox$ ./hello +hello, workd! +kbox$ _ + + +

A remarkable list of command-line programs can be compiled for Android. Among others, I ported the Bywater BASIC interpreter: @@ -1451,7 +1481,7 @@ name="http://abcplus.sourceforge.net/">

In general, any program that doesn't depend on fancy libraries is -immediately portable to Android. Explanations on compiling stuff in +readily portable to Android. Explanations on compiling stuff in Android are available here:

@@ -1894,30 +1924,32 @@ url="http://www.osmand.net" name="http://www.osmand.net">.

Congratulations! You have now some basic information on how to turn your Andbox into something useful, and how to interact with it using -your trusted Linux machine. +your trusted GNU/Linux machine.

At the end of this document, I can confess you the truth: while I'm a -long-term GNU/Linux fan, I'm afraid I don't really like Android. I -find it insanely fragmented, sluggish, laggy; I also believe it -suffers from a few fundamental design flaws. Besides, I don't like -tablets, all of them. I find way too limited, if compared to a real -computer; I'm a sysadmin after all. +long-term GNU/Linux fan, I'm afraid I've just started to appreciate +Android. I find it insanely fragmented; until recently, it was +unacceptably sluggish and laggy; I also believe it still suffers from +(at least) a couple of serious design flaws. Besides, I don't like +tablets, all of them; I find way too limited, if compared to a real +computer. That said, I can say that my 8-core, Android 5.0.1-based +phone is quite nice.

-That said, I hope this guide provided some useful information. It's -only the beginning: please stay tuned for updates. +I hope this guide provided some useful information. It's only the +beginning: please stay tuned for updates. Copyleft

-This document is released under the GNU Free Documentation License, -obtainable here: +This document is released under the GNU Free Documentation License +1.3, obtainable here:

-. +.

This document is provided ``as is''. I put a great amount of effort @@ -1931,16 +1963,3 @@ Enjoy,     Guido =8-) - - - -