Friday, January 11, 2008

Get start playing with Google Android

The Android platform is a software stack for mobile devices including an operating system, middleware and key applications. Developers can create applications for the platform using the Android SDK. Applications are written using the Java programming language and run on Dalvik, a custom virtual machine designed for embedded use which runs on top of a Linux kernel.

Google provides Android SDK for three platforms: Windows, Mac OS X (intel), Linux (i386). There is Android emulator included in the SDK package. So first find a Android SDK for your platform: Download the Android SDK from Google.

Next, extract the Android SDK package into your system, let's say the root folder is $ANDROID_SDK.

Open a command window (shell window), change the working directory to $ANDROID_SDK/tools/. You will see tens of executable files, one is emulator. Simply start it with the following command:
# emulator
If you want to see the emulator kernel boot up detail information, start it with the following command:
# emulator -debug-kernel

When the Android started up, the following window is shown.
You can open a Android shell by the command:
# adb shell

It is a Linux kernel 2.6.23 (Android is linux kenel based) shell, play with it in the same way as linux.

Here is the Android kernel boot up log fyi:
Uncompressing Linux.............................................................
.................... done, booting the kernel.
Linux version 2.6.23-gcc3bc3b4 ( (gcc version 4.2.1
) #3 Tue Oct 30 16:28:18 PDT 2007
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00003137
Machine: Goldfish
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-through cache
CPU0: I cache: 4096 bytes, associativity 4, 32 byte lines, 32 sets
CPU0: D cache: 65536 bytes, associativity 4, 32 byte lines, 512 sets
Built 1 zonelists in Zone order. Total pages: 24384
Kernel command line: qemu=1 console=ttyS0 android.checkjni=1 keycharmap=qwerty2
Unknown boot option `android.checkjni=1': ignoring
Unknown boot option `': ignoring
PID hash table entries: 512 (order: 9, 2048 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 96MB = 96MB total
Memory: 94280KB available (2268K code, 458K data, 96K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
android_power_init done
NET: Registered protocol family 16
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
checking if image is initramfs... it is
Freeing initrd memory: 228K
goldfish_new_pdev goldfish_interrupt_controller at ff000000 irq -1
goldfish_new_pdev goldfish_device_bus at ff001000 irq 1
goldfish_new_pdev goldfish_timer at ff003000 irq 3
goldfish_new_pdev goldfish_rtc at ff010000 irq 10
goldfish_new_pdev goldfish_tty at ff002000 irq 4
goldfish_new_pdev goldfish_tty at ff011000 irq 11
goldfish_new_pdev smc91x at ff012000 irq 12
goldfish_new_pdev goldfish_fb at ff013000 irq 13
goldfish_new_pdev goldfish_audio at ff004000 irq 14
goldfish_new_pdev goldfish_events at ff014000 irq 15
goldfish_new_pdev goldfish_nand at ff015000 irq -1
goldfish_new_pdev goldfish-switch at ff016000 irq 16
goldfish_new_pdev goldfish-switch at ff017000 irq 17
goldfish_pdev_worker registered goldfish-switch
goldfish_pdev_worker registered goldfish-switch
goldfish_pdev_worker registered goldfish_nand
goldfish_pdev_worker registered goldfish_events
goldfish_pdev_worker registered goldfish_audio
goldfish_pdev_worker registered goldfish_fb
goldfish_pdev_worker registered smc91x
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_rtc
goldfish_pdev_worker registered goldfish_timer
goldfish_pdev_worker registered goldfish_device_bus
goldfish_pdev_worker registered goldfish_interrupt_controller
Installing knfsd (copyright (C) 1996
yaffs Oct 30 2007 16:24:34 Installing.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
allocating frame buffer 320 * 480, got ffc10000
Console: switching to colour frame buffer device 40x30
console [ttyS0] enabled
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
loop: module loaded
nbd: registered device at major 43
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre
No IRQF_TRIGGER set_type function for IRQ 12 (goldfish)
eth0: SMC91C11xFD (rev 1) at c6800000 IRQ 12 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
goldfish nand dev0: size 4000000, page 2048, extra 64, erase 131072
goldfish nand dev1: size 4000000, page 2048, extra 64, erase 131072
mice: PS/2 mouse device common for all mice
*** events probe ***
events_probe() addr=0xc6804000 irq=15
input: goldfish-events-keyboard as /class/input/input0
goldfish_rtc goldfish_rtc: rtc core: registered goldfish_rtc as rtc0
logger: created 64K log 'log_main'
logger: created 64K log 'log_events'
logger: created 64K log 'log_radio'
IPv4 over IPv4 tunneling driver
GRE over IPv4 tunneling driver
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear
All bugs added by David S. Miller
VFP support v0.3: implementor 41 architecture 1 part 10 variant 9 rev 0
goldfish_rtc goldfish_rtc: setting the system clock to 2008-01-12 02:48:13 (1200
Freeing init memory: 96K
init: reading config file
init: device init
init: mtd partition -1,
init: mtd partition 0, "system"
yaffs: dev is 32505856 name is "mtdblock0"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.0, "mtdblock0"
init: mtd partition 1, "userdata"
yaffs: dev is 32505857 name is "mtdblock1"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.1, "mtdblock1"
eth0: link up
sh: can't access tty; job control turned off
# binder_open(c0833428 c0a0a4a0) (pid 468) got c5f13000
binder_open(c0833428 c5a6b9e0) (pid 460) got c5bbf000
binder_open(c0833428 c5a6b2e0) (pid 474) got c4716000
android_power: auto off timeout set to 604800 seconds
Descriptor2Node failed secondary: desc=4, max=32, node=c5bc0350, weak=0
binder_open(c0833428 c4f533a0) (pid 510) got c4754000
binder_open(c0833428 c4f53920) (pid 511) got c3a30000
binder_open(c0833428 c3421860) (pid 527) got c3428000


milf said...

1。那混合物是更缓慢的 ... 但是 Lexus 的即将到来混合版本 ' 将是比气体气体更快的唯一的版本如好地有多马力。不要自夸速度,但是我被吸引轮流开送行为 90,是警察给我一次休息。
... 只是通过在城市乘公交车往返我储蓄过来 $ 5000/yr 与我的以前的汽车,吉普车切诺基相比。超过 5 年,会是 $ 更不用说会进一步增强我的储蓄的最近的比率远足的 20K。这样除非你是在你的父母的地产上吸的一个浪费的儿子,你的声明是一束公牛。

milf said...

3. 45 (90 r/t)
45mpg 天是 2 我的车上> 8 加>>比。那每天是 6 >仑的一笔>蓄, 120 月, 1440 每年者 5040 (根 3.5 元/) ... 加上它发表 1/10th CO2。多愚蠢是它不要骑一个,去算进今天和年龄。
4.缺少了解 ... 是真的,实际上我个人这样那样喜欢它我可能享受所有鼓励;税,合伙用车,免费停车米, prius 业主之间的秘密的信号,等等;这样自私地说那我真地在那里在享受在所有气体汽车业主上的所有权那没有一个想法多少我这辆汽车有的嬉戏。我 junked 我的 SL,郊区对我的 Prius ... 你应该也。

jav said...

How do you manage to get a hold of the boot log?
I can't find any info about how to access it, only people who list it's contents :)

Thank you // Jav

Pavan said...

>adb pull /proc/kmsg C:\BootLog.txt

Install ADB shell and run above command and you will get your boot log!

Pharmacy Blogger said...

Thanks for sharing an interesting post would like to have an regular visit
Generic Plavix