[Android] mrbox23:
I learned about this here... http://fieldeffect.info/w/NativeCompileSDK

You can install an i386/x86_64 chroot within your existing Debian chroot using qemu-user-static to run the Android SDK on your Android phone/tablet/phablet.

1.

Get yourself a debian chroot, I recommend at least 2gb. I use DebianKit from market.

2.

You will need a X11 desktop environment and a VNC client on your device. I use androidVNC from market.

Here is my working example...

Start your Debian chroot/environment and do...

apt-get install openbox openbox-themes obmenu obconf menu menu-xdg xdg-utils xfonts-base xfonts-terminus* nautilus terminator lxappearance gmrun leafpad man-db hicolor-icon-theme tightvncserver tint2

That gives you a window manager, fonts, filebrowser, terminal emulator, text editor, theme manager, taskbar, and a VNC server.

Now lets get some GTK engines and libraries....

apt-get install gtk2-engines-auroa gtk2-engines-murrine gtk2-engines-oxygen gtk2-engines-pixbuf libgtk2.0-bin gtk3-engines-oxygen gtk3-engines-unico libgtk-3-bin

Now 7zip to handle zips and archives comfortably(put non-free in your apt sources.list)...

apt-get install p7zip p7zip-full p7zip-rar zip unzip

##The Android SDK manager, qemu, and multistrap##

apt-get install ant file openjdk-6-jre openjdk-6-jdk qemu-user-static libswt-gtk-3-java libswt-cairo-gtk-3-jni

3.

Now we can build a small x86_64 rootfs using multistrap

multistrap can use a config, have mine...

http://db.tt/hS5j3wg

Copy multistrap.conf straight into your working(pwd) directory....

cp /sdcard/Download/multistrap.conf .

Do this to avoid multistrap complaining later...

cat multistrap.conf >mstrap

mkdir /data/mnt

Determine size of rootfs for loop image..

du -hs /data/mnt/

Now make an image for x86_64 chroot

dd if=/dev/zero of=/sdcard/64bit.img bs=$(( 0x100000 )) count=YOUR IMAGE SIZE

That byte size makes your image slightly larger than the count value in Mb, for example count=78 will write 82Mb image.

mkfs.ext2 /sdcard/64bit.img

tune2fs -c0 /sdcard/64bit.img

mkdir /data/tmp

busybox mount -o loop /sdcard/64bit.img /data/tmp/

cp -r /data/mnt/* /data/tmp/

umount /data/tmp

rm -r /data/tmp/

rm -r /data/mnt/

mkdir /data/mnt

busybox mount -o loop /sdcard/64bit.img /data/mnt/

5.

Now the environment is set up and mounted, at this point install the SDK

Aim your browser to http://developer.android.com/sdk/index.html

Select "Linux" from "SDK Tools Only", thats the last thing at the bottom of the list.

cp /sdcard/Download/android-sdk_r21.0.1-linux.tgz .

7z x android-sdk_r21.0.1-linux.tgz russosv

7z x android-sdk_r21.0.1-linux.tar

Now we need a couple goodies from http://fieldeffect.info/w/NativeCompileAPK ##--Thanks to russosv from FeildEffect

These are edited from original....

#!/bin/bash

QEMU=/usr/bin/qemu-x86_64-static

64CHROOT=/data/mnt/

case "$1" in

mklinks)

if [ ! -e "./64BIT" ]; then

mkdir ./64BIT

fi

for i in $(file ./* | grep "ELF 32" | awk '{print $1}' | sed s/://g | sed s/[./]//g); do

echo "Moving $i..."

mv $i ./64BIT

ln -s ~/bin/run-64-link $i

done-

;;

*)

$QEMU $64CHROOT/lib64/ld-linux-x86_64.so.2 --library-path $64CHROOT/lib:$64CHROOT/usr/lib:$64CHROOT/usr/share/perl/5.12.4/unicore/lib:$64CHROOT/var/lib:$64CHROOT/lib/x86_64-linux-gnu:$64CHROOT/usr/lib/x86_64-linux-gnu $@

;;

esac

Copy that to run-64, then...

chmod 755 run64

cp run-64 /usr/bin/

One more...

echo $(dirname $0)/64BIT/$(basename $0) $@

/usr/bin/run-i386 $(dirname $0)/64BIT/$(basename $0) $@

Make that run-64-link

chmod 755 run-64-link

cp run-64-link /usr/bin/

5b.

Now launch VNC server

tightvncpasswd

tightvncserver

killall Xtightvnc

cat >.vnc/xstartup<<EOF

tint2 &

terminator &

openbox-session

EOF

tightvncserver

export DISPLAY=:1

6.

Now launch the VNC client I mentioned earlier, should connect with 127.0.0.1:5901 and your password you set.

Go back to terminal or use the one launched on X11 to do...

sh android-sdk-linux/tools/android

Install at least one api.

If all went well you can now go around "debugging" yours and your friends Android devices over wifi now.

For an example, and to see it work do....

svc wifi disable(or enable) ##this turns off/on wifi

setprop service.adb.tcp.port 5555(or -1) ##this turns on/off adb over network

stop adbd

start adbd

adb connect 127.0.0.1(yours) or any other adbd addy listening on your network,

Have fun :)

Never did a "how to" before, go easy and I'll make corrections and answer things. Thanks for reading. Leave feedback.