RotateView - Android Applet

I wrote a small Android applet to rotate the view.


Download and unzip it. Then copy RotateView/bin/RotateView.apk to android-root/data/app. When you restart Android, you will find RotateView icon in Applications folder.

There are four view styles. Just select and click.

Nice to have Android Zaurus in landscape view.

The view style will be effective until rebooting Android.

This small applet may come in handy when you are playing with Android Zaurus. It also works in the Android SDK emulator.

You will notice that OpenGL demo applet runs much slower in landscape view than portrait view. Graphic manager rotates images by software.

Technically, this applet is nothing new. As I already reported in Portrait/Landscape and Keycode, Davanum found service call command and IWindowManager has an API to rotate the view.

I'm just sick of typing in the service call command everytime I boot up my Android Zaurus and decided to write an quick applet.

Have fun.

RotateView applet contains a free icon from iconlet. I could download a nice icon in no time because of the simple user interface of iconlet.

posted by 安藤恐竜 at 16:14 | Comment(0) | TrackBack(0) | 日記


i18n check by Google News

By looking around Google News, I tested how Android supports i18n so far.

U.S. and international menu.
gnews-us.png    gnews-menu.png

Japan, Taiwan, Hong Kong, China.
gnews-jp.png    gnews-tw.png    gnews-hk.png    gnews-cn.png


Russia, Italy, France and Chez.
gnews-rusia.png    gnews-italia.png    gnews-france.png    gnews-cheska.png

Arabic and Hindu. These are not supported yet.
gnews-arabic.png    gnews-india.png
posted by 安藤恐竜 at 22:57 | Comment(0) | TrackBack(0) | 日記


setconsole and tty1

setconsole -v 1 command in android shell switches the display from Android GUI to a text console. But the text console on Zaurus couldn't work correctly because android-root/init wants /dev/tty1 which is already taken by Linux console.

A dirty work around. Change the Linux console to /dev/tty2. Edit the last line of /etc/inittab;
1:2345::/sbin/getty 38400 tty1
2:2345:respawn:/sbin/getty 38400 tty2
Then reboot and ./start-android.sh.


Pressing [Fn] and cursor at the same time switches the display between Android GUI and the text console. In the text console, Android shell commands like getprop, setprop, service call and mem_profiler can be executed.

In emulator environment, these commands can be run by adb shell.
posted by 安藤恐竜 at 23:50 | Comment(0) | TrackBack(0) | 日記

Screenshots of Android Zaurus

I was such an idiot I haven't thought of taking some screenshots, before crying for a digital camera.

ipkg install fbgrab, then take some shots.

Booting up from either Zaurus console or ssh. My script is ./start-android.sh.


Booting up. The famous red cylon.

Home. View mode can be changed by service call window 18 i32 1 command. Change 1 to 0 for portrait. 2 and 3 can be tried. Make the view upside-down, left-right flipped.
home.png    home-l.png

Browser. Japanese Kanji. Note that the menu is beautifully alpha brended.

Zoom. And zoom in more.
brawser3.png    brawser4.png

Google Map. Satellite and Traffic.
gmap2.png    gmap3.png


OpenGL. Rotating.
opengl2.png    opengl.png

Demo of twitter on Andriod, written by Adamrocker. Unzip the androitter.zip and copy apk to android-root/data/app.
androitter1.png    androitter2.png    androitter3.png    androitter4.png
I'm happy that I can confirm applets buit by Eclipse really run on a hardware. And not only the browser but also applets can display Japanese Kaji.

But... Fonts are too small to read. It could be much better if the applet has zoom function.

Touch pannel doesn't work yet. And I want Japanese input method. I wonder there is Java version uim. If so, wrap it up as Android service, I guess.
I forgot to mention the alarm function. If the kernel configured as ANDROID_POWER = y with patching android.diff, alarm applet works fine. /dev/alarm is the device file of it.

Alarm in API Demos. 15 seconds message comes up every 30 seconds. The alarm message comes up even running another applet.
alarm1.png    alarm2.png    alarm3.png
posted by 安藤恐竜 at 18:52 | Comment(2) | TrackBack(1) | 日記

さらに簡単Android Zaurus


SDカードにコピーしてZaurusに刺し、リセットボタンを押してから、OKを押しつつ電源オン。アップデートするだけでAndroid Zaurus。


android-root/initでAndroidを動かしてないので、DNSが引けないかも。android-root/startのスクリプで、zygote, dbus, runtimeの代わりに、init一発にすればDNSが引けるようになる。あと、/etc/network/interfacesにやっぱりusb0 gatewayがあるので、それは削除。

posted by 安藤恐竜 at 12:48 | Comment(2) | TrackBack(0) | 日記


ビルド済みバイナリでもAndroid Zaurus


ただし、アラームが動きません。powerドライバがモジュールでビルドできなかったので。API Demosにあるアラーム系は無理ぽ。


  1. Angstrom-console-imageをゲット
  2. 意を決してインストール
  3. 遊んでみつつ、sshの動作確認
  4. Android SDKを落としてきて母艦に入れる
  5. systemdataのイメージもゲット
  6. ramdisk.imgをcpioで展開し、systemとdataをtarで展開 → Google Android runs on Sharp Zaurus SL-C3000
  7. ごっそりtarで固めて、リナザウにコピーし、android-rootとかのディレクトに展開
  8. start-android.shを作成し、chmod 755 → Android Zaurus on a ready-made Angstrom image
  9. android-root/a.shを作成 → Network is up.
  10. DNSアドレスを設定 → A better way to bring network up.
  11. usb0のゲートウェイ設定を削除 → A better way to bring network up.
  12. binderをインストール → Android Zaurus on a ready-made Angstrom image
  13. # ./start-android.sh
  14. 画面の回転とキーコード → Portrait/Landscape and Keycode

posted by 安藤恐竜 at 17:50 | Comment(1) | TrackBack(0) | 日記

Android Zaurus on a ready-made Angstrom image

Good news. I tried today to build binderdev.ko as a module and insmod it to ready-made Angstrom-console-image. Android works.

It makes a lot easier for people who wants just a look how it works.
1) Download Angstrom-console-image from Angstrom library.
2) Install it to Zaurus.
3) Download this binder-angstrom.tar.gz.
4) Unzip it and copy binderdev.ko to Zaurus.
$ tar zxvf binder-angstrom.tar.gz
$ cd binder-angstrom
$ scp binderdev.ko root@zaurus:/home/root
$ ssh root@zaurus
# cd /lib/modules/2.6.23/kernel/drivers/
# mkdir binder
# mv /home/root/binderdev.ko .
# depmod -a
# modprobe binderdev
# ls -l /dev/binder
crw-rw---- 1 root root 252, 0 Dec 28 06:10 /dev/binder
# cd /home/root/android-root/dev
# cp /dev/binder .
# chmod 666 binder

Now just jump to Android stuff in my previous entry.

Revised start-android.sh would be;
modprobe binderdev
rm -f /home/root/android-root/tmp/*
umask 000
chroot /home/root/android-root /a.sh

There's a drawback. I couldn't build power.ko as a module. This power driver has built-in alram function which is bound to /dev/alarm.

Result is Alarm applet in API Demos doesn't work at all. Other alarm related applet won't work, I guess.
posted by 安藤恐竜 at 16:16 | Comment(0) | TrackBack(0) | 日記


カーネル読書会とかAndroid Zaurusメモとか



途中、トラブルでustream.tvがoff airになっちゃったところで、
Nice boat.
Nice boat.
Nice boat.



さて。Android Zaurus。英語エントリが続いたので、軽く日本語でまとめ。
o ネットワーク使える。Google Map見られるようになった。
o 日本語表示OK。AppletからもOK。Browserを拡大表示にして見たら、フォントがキレイすぎて腰抜けた。さすが、Sharpのシステム液晶。
o αブレンディングも綺麗に表示される。さすが、Sharpのシステム液晶。
o キーレイアウトをちょっといじった。
o Portrait/Landscapeの切り替えOK。ただし、Landscape(横長)にすると描画が遅くなる。デフォがPortrait(縦長)になっているらしい。で、ソフトで回転しているため、激遅。
o タッチパネルは動いたり動かなかったり。安定しない。PC上のエミュレータでもマウスクリックが効かなかったりすることがあるので、何か根本的な問題があるかもしれない。


ふんがーとかNice Boat.とかのネタがわからない人向けの蛇足。

(*1) さーはじまるざますよ云々は、らき☆すたのオープニング。オリジナルは怪物くんだから、一定以上の年齢には懐かしい部類か。

(*2) Nice boat.は、やはりアニメのスクールディズが、映像表現の問題で急遽放映中止となり、かわりに延々と航行する船の映像が流れ、それを見た海外オタクがとある掲示板で一言「Nice boat.」と書いたことから、大流行。


ZaurusをAndroid化するプロジェクトを始めるまで、My Zaurusは英語ニュース記事をGoogle翻訳を使って機械翻訳して、とあるブログに投稿し続けるという仕事を、1年以上にわたって続けてました。その仕事を黙々と続けていたのは、Zaurus上で動作する自作Rubyスクリプトだったわけで。メモリリークもなく、トラブルもなく、1年以上にわたって安定して動き続けたRubyとZaurusに感動しますた。RubyかわいいよRuby。ZaurusかわいいよZaurus。
posted by 安藤恐竜 at 23:19 | Comment(0) | TrackBack(0) | 日記


Portrait/Landscape and Keycode

To rotate from portrait view to landscape view, I found this hack in the Android Developers Group.
# service call window 18 i32 1

To make the keyboard work more nicely, I wrote a short applet to check key events. Scan codes of special keys are
    Side Key 

I add following lines to andriod-root/system/usr/keylayout/qwerty.kl. Well, tentatively.
key 108 DPAD_LEFT
key 103 DPAD_RIGHT
key 105 DPAD_UP
key 106 DPAD_DOWN
key 62 BACK
key 88 SOFT_LEFT
key 99 HOME
key 64 BACK
key 66 VOLUME_UP
key 57 SPACE
key 61 FN

This is not perfect at all. The layout is English keyboard and my Android Zaurus has a Japanese keyboard. Also, Fn-markup does't work. May need to build android-root/system/usr/keychars/zaurus.kcm.bin. I don't know how yet, though.

Next thing is touch pannel. Sometimes it works. Next moment, it doesn't. Very unstable.
posted by 安藤恐竜 at 19:03 | Comment(1) | TrackBack(0) | 日記

A better way to bring network up.

Instead of typing in setprop command on Android Zaurus console, put the following line into android-root/etc/default.prop
net.eth0.dns1 = xx.yy.zz.qq

Where xx.yy.zz.qq is IP address of your DNS server, ovbiously.

By the way. Don't forget delete the gateway setting in usb0 interface in /etc/network/interfaces. I still don't get why Angstrom uses this tricky interface as a default gateway.
posted by 安藤恐竜 at 07:20 | Comment(0) | TrackBack(0) | 日記


Network is up.

My Android Zaurus got network up! setprop/getprop works after android-root/init runs through. Modify android-root/a.sh
export PATH=/sbin:/system/sbin:/system/bin:$PATH
export LD_LIBRARY_PATH=/system/lib
export ANDROID_ROOT=/system
export ANDROID_ASSETS=/system/app
export ANDROID_DATA=/data
export EXTERNAL_STORAGE=/sdcard
export DRM_CONTENT=/data/drm/content

mount -t proc proc /proc
mount -t sysfs sysfs /sys

/init &

Then ssh to zaurus,
$ ssh root@zaurus
# rm -f android-root/tmp/*
# umask 000
# chroot /home/root/android-root /a.sh

After Android boots up, in the ssh console hit enter key, then issue setprop command.
\u@\h:\w\$ init: HOW ARE YOU GENTLEMEN
init: reading config file
init: device init

\u@\h:\w\$ setprop net.eth0.dns1 xx.yy.zz.qq

DEPRICATED by A better way to bring network up.

Hit [Enter] key of Android Zaurus keyboard, type somemthing in and hit [Enter] again. Google rules!

[Calendar] key (bottom-left key) works as [Menu] and [Cancel] key (next to the circle cursor key) works as cancel.

Have fun.
posted by 安藤恐竜 at 21:18 | Comment(1) | TrackBack(0) | 日記


can't setprop net.eth0.dns1

Android applets on my Android Zaurus can't resolve DNS because DNS server address should be set with setprop command.
# /system/bin/setprop net.eth0.dns1 xx.yy.zz.qq

But... This command can not be issued in ssh console because Android runs on chrooted system tree.

So far I've tried;
o android-root/a.sh
o android-root/etc/default.prop
o android-root/data/local.prop
o android-root/etc/init.rc

None of these could set net.eth0.dns1 successfully yet. orz

Where should I look into?
posted by 安藤恐竜 at 10:41 | Comment(4) | TrackBack(0) | 日記




まだ、Android appletからネットワークに出られない(Google Mapが見えなくて寂しい)とか、タッチパネルが使えないとか、まだヘロヘロなので、今後ぽちぽちと改善していきましょうかな。


posted by 安藤恐竜 at 14:08 | Comment(4) | TrackBack(0) | 日記

Google Android runs on Sharp Zaurus SL-C3000

Now my Zaurus C3000 becomes an Android Zaurus.

I've followed Gergely's blog Google Android runs on Sharp Zaurus SL-C760 and got pretty much the same result.

o Keyboard working
o Touch panel not working
o Network from Android applet not working

I'll play with my Android Zaurus and I'll write another entry once I get some progress --- hopefully.

Here's the step by step what I did. I'm a newbie to OpenEmbedded, so there are better way to get, I guess.

First of all, get the OpenEmbedded environment. Follow the Building Angstrom | The Angstrom Distribution instruction.
$ mkdir -p openembedded/build/conf
$ cd openembedded
$ svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake
$ wget http://www.openembedded.org/snapshots/OE.mtn.bz2
$ bunzip2 OE.mtn.bz2
$ sudo apt-get install monotone
$ mtn --db=OE.mtn checkout --branch=org.openembedded.dev
$ cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
$ vi build/conf/local.conf
$ diff org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
< BBFILES := "${@bb.fatal('Edit your conf/local.conf: BBFILES')}"
> BBFILES = "/path/to/openembedded/org.openembedded.dev/packages/*/*.bb"
> MACHINE = "spitz"
< # DISTRO = "angstrom-2007.1"
> DISTRO = "angstrom-2007.1"
< IMAGE_FSTYPES = "jffs2 tar"
> IMAGE_FSTYPES = "jffs2 tar.gz"
< # PARALLEL_MAKE = "-j 4"
> PARALLEL_MAKE = "-j 4"
< REMOVE_THIS_LINE:="${@bb.fatal('Read the comments in your conf/local.conf')}"

Now prepare some tools required to build. I did these installations while I was in try and error course, some might not be required.
$ sudo apt-get install help2man diffstat texi2html cvs gawk texinfo quilt autoconf
$ sudo apt-get install gcc-3.3 subversion monotone

If you are using Ubuntu (like me), you need to install kernel build packages, too.
$ sudo apt-get install build-essential kernel-package libncurses5-dev

To apply benno's android.diff in bitbaking time, modify the linux-rp_2.6.23.bb file. Also, linux-2.6.23.tar.bz2 in www.kernel.org already branched to some minor versions and not there anymore. So change the source to angstrom-distribution.org.
$ cd openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23
$ wget http://benno.id.au/android/android.diff
$ cd ..
$ cp linux-rp_2.6.23.bb linux-rp_2.6.23.bb.kernel.org
$ vi linux-rp_2.6.23.bb
$ diff linux-rp_2.6.23.bb.kernel.org linux-rp_2.6.23.bb
< SRC_URI = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.23.tar.bz2 \
> SRC_URI = "http://www.angstrom-distribution.org/unstable/sources/linux-2.6.23.tar.bz2 \
> file://android.diff;patch=1 \
$ cd openembedded/org.openembedded.dev/conf
$ cp checksums.ini checksums.ini.org
$ vi checksums.ini
$ diff checksums.ini.org checksums.ini
> [http://www.angstrom-distribution.org/unstable/sources/linux-2.6.23.tar.bz2]
> md5=2cc2fd4d521dc5d7cfce0d8a9d1b3472
> sha256=d4e67c0935ffb2a4158234bff92cc791b83177866009fc9b2214104e0038dbdb

I came across a few errors while applying android.diff pacth, so I modified android.diff a little. Here's my version of android.diff. androidzaurus.tar

Start building toolchain. It takes very long. Telling you, veeerrrry looooong. With my Athlon 3500, I takes well half a day.
$ export PATH=~/openembedded/bitbake/bin:$PATH
$ export BBPATH=~/openembedded/build:~/openembedded/org.openembedded.dev
$ bitbake task-sdk

If fails, try some googles and bitbake task-sdk again.

To check the toolchain, try to build a minimal-image.
$ bitbake minimal-image
$ ls tmp/deploy/glibc/images/spitz/

Now I got kernel source tree. Try to retreive .config as defconfig-spitz. Also, turn Android specific configurations on. Here's my current defconfig-spitz. androidzaurus.tar
$ cd openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23
$ cp defconfig-spitz defconfig-spitz.org
$ cd tmp/work/spitz-angstrom-linux-gnueabi/linux-rp-2.6.23-r10/linux-2.6.23
$ make oldconfig
$ make menuconfig
$ cp .config /path/to/openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23/defconfig-spitz
$ diff ../defconfig-spitz .config
> # Android
> #
> #

Let's build an Android-configured-Angstrom-kernel and console image.
$ bitbake linux-rp -c rebuild
$ bitbake console-image

Now ready to make Zaurus to Angstrom Zaurus. If you are new to altanative ROM (like me), first backup everything from your Zaurus. It is possible to make your Zaurus to a dead brick.

Copy the fresh baked image to Zaurus. Note that commands with $ prompt are on the host PC. Lines with # prompt are on Zaurus.
$ cd tmp/deploy/glibc/images/spitz/
$ scp Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit.tgz root@zaurus:/home/root
$ ssh root@zaurus
# gunzip Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit.tgz
# tar xvf Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit
# mv Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit /your/sdcard/root
# poweroff

I forgot to take a memo of the default mount point. Please check with mount command.

Time to burn the Angstrom image. Angstrom installation on Spitz | The Angstrom Distribution shows how to flash very well.
1) Shutdown Zaurus with poweroff command.
2) Flip Zaurus and unlock the battery switch. Open the battery cover.
3) Push the reset switch. It's a small rectangle black one.
4) Put the battery cover back and the lock switch on.
5) While pressing OK key in the center of cursor key, press On/Off switch.
6) Select "Update" and press OK key.
7) Select "SD Card" and press OK key.
8) Say Yes to the warning.
9) Cross your fingers and hold your breath.

Play with new Angstrom Zaurus and make sure you have ssh access to it. It would be better to modify /etc/network/interfaces to get rid of usb0 as default route. Just delete the gateway lines in usb sections.
$ ssh root@zaurus
# route del default
# vi /etc/network/interfaces

Now Android stuff. It's well explained in Google Android runs on Sharp Zaurus SL-C760. You also need Android SDK and unzip it.
$ cp /path/to/android-sdk/tools/lib/images/ramdisk.img ramdisk.img.gz
$ wget http://benno.id.au/android/system.tar.gz
$ wget http://benno.id.au/android/data.tar.gz
$ scp ramdisk.img.gz system.tar.gz data.tar.gz root@zaurus:/home/root
$ ssh root@zaurus
# gunzip ramdisk.img.gz
# gunzip system.tar.gz
# gunzip data.tar.gz
# mkdir android-root
# cd android-root
# cpio -iv < ../rammdisk.img
# tar xvf ../system.tar
# tar xvf ../data.tar
# vi a.sh
# cat a.sh


export PATH=/sbin:/system/sbin:/system/bin:$PATH
export LD_LIBRARY_PATH=/system/lib
export ANDROID_ROOT=/system
export ANDROID_ASSETS=/system/app
export ANDROID_DATA=/data
export EXTERNAL_STORAGE=/sdcard
export DRM_CONTENT=/data/drm/content

mount -t proc proc /proc
mount -t sysfs sysfs /sys

/system/bin/app_process -Xzygote /system/bin --zygote &
/system/bin/dbus-daemon --system &

a.sh should be same as Google Android runs on Sharp Zaurus SL-C760.

Copy all of the device files to android-root. Then chmod the binder to 666. If you don't change the binder access mode, you will end up looking at red cylon forever.
# cd /dev
# tar cvf /home/root/dev.tar .
# cd /home/root/android-root/dev
# tar xvf /home/root/dev.tar
# chmod 666 binder

Final moment. Start Android.
# rm -f android-root/tmp/*
# umask 000
# chroot /home/root/android-root /a.sh

This could be a shell script as in Google Android runs on Sharp Zaurus SL-C760.

Have fun.

Todo is;
o Bring network up for Android applet.
o Keycode in android-root/etc/init.rc.
o Hack touch pannel driver to generate Android event.
o Vertical/Horizontal view style.
o Localization. I want my Japanese font and IM :-)
posted by 安藤恐竜 at 13:55 | Comment(25) | TrackBack(0) | 日記




・マイブログの【設定】 > 【広告設定】 より、「60日間更新が無い場合」 の 「広告を表示しない」にチェックを入れて保存する。