Monday, April 13, 2009
Android SDK
android sdk 1.1 r1 : http://dl.google.com/android/android-sdk-windows-1.1_r1.zip
Android 1.5 SDK, Release 1中文版发布!: http://www.eoeandroid.com/viewthread.php?tid=154&extra=page%3D1
http://source.android.com/download
Monday, March 2, 2009
android tips
====================================================
SD card mount command
mount –t vfat /dev/block/mmcblk0p1 /sdcard
====================================================
Busybox for android : http://benno.id.au/blog/2007/11/14/android-busybox
Add a new component into open source Android
转自: http://discuz-android.blogspot.com/2008/11/add-new-component-into-open-source.html
The android build system is complicated. It is not easy to create a simple build script to build single component. But it is much easier to add a new component into the build system. Here is a sample to build the "Hello world!" for Android, and it is dynamic linked executable.
- create a directory for the new component in $(YOUR_ANDROID)/external folder: $(YOUR_ANDROID)/external/hello
- put the hello.c into the directory: $(YOUR_ANDROID)/external/hello/
- create Android.mk in $(YOUR_ANDROID)/external/hello/ directory, the Android.mk likes the following:
LOCAL_PATH:=$(call my-dir)
include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES:= \
hello.c
LOCAL_MODULE := hello
include $(BUILD_EXECUTABLE) - add the following line into $(BUILD_SYSTEM)/main.mk,$(BUILD_SYSTEM) is in $(YOUR_ANDROID)/build/core:
external/hello ( find the external/zlib in main.mk? Append your lines after that.) - launch the build command in $(YOUR_ANDROID): make hello
You can use include $(BUILD_SHARED_LIBRARY) to create shared library. Find more in $(YOUR_ANDROID)/build/core/config.mk.
Thursday, February 5, 2009
Dalvik和J2ME相比先进到了哪里?
转自: http://grachel1986.blog.163.com/blog/static/56603893200893113816630/
很多人目前不知道Android的Dalvik虚拟机和Sun J2ME相比先进在哪里?今天GPhone之家就一起给大家分析下Dalvik和J2ME的区别。首先Dalvik虚拟机是Google自己开发的 Java虚拟机,运行在Android平台上。J2ME是Sun公司的移动平台Java VM。
一、运行环境对比
Dalvik工作在Linux内核的Android操作系统上,而J2ME工作在目前主流的手机操作系统Symbian、UIQ、Windows Mobile等,目前还不支持iPhone Mac OS。
二、模拟器
Dalvik在Android平台上的模拟器为Qemu,而J2ME官方的是WTK,同时摩托罗拉、索尼爱立信、诺基亚都有自己的模拟器,同时Symbian J2ME有更多的扩展类,诺基亚的扩展类兼容性最差。
三、兼容性
Dalvik和J2ME相比兼容性算是最大的突破,要知道J2ME的各个手机公司之间的移植就很麻烦,除了分辨率、硬件差异要考虑外,还有很多扩充类的问题。而Android Dalvik工作在Google开放手机联盟中,可以完全脱离硬件困扰。(除了一些差异如QWERTY和触摸屏)
四、运行效率
这一点是大家最关心的问题,Android Dalvik会把Java Class编码转换为Dex,Dex是Dalvik VM executes的缩写,经过内存和运行效率的优化,而J2ME的为KJAVA,千字节的Java VM所以在资源上控制的也很好,最终性能如何要等到Gphone真机发布做完整评论,不过Dalvik是基于寄存器构架,而JavaME基于栈的,可以缩短编译时间外,在静态做了更多的优化,目前Gphone手机的硬件配置还不确定所以无法用开发板单一测试,但Android工作在ARM9-926上,基本测试出来开发系统应用比一般的非智能手机快很多,和Symbian C++以及WinCE相比仍然有差距。间
五、安全性
Java一向倡导安全性,从内存分配和高层上看不会有很多危险的操作,这是在J2ME上来看。而Dalvik作为Android平台级开发语言必然会涉及系统权限问题,如Linux的磁盘、用户控制等,不过Android平台通过一个WPF的模型,AndroidManifest.xml文件统一管理,类似Symbian中的能力一样,所以基本可以放心使用。
六、类库完整性
这一点可以说Sun比较全面,但是我们看到Dalvik实际上是对JME的补充,并不是重写实现,除了显示UI系统又比较大的变革外,其他的还是很兼容的,所以目前版本的Dalvik已经包含了一些重要的特性,如Base64编码、XML DOM、MD5处理,影音解码器、地图控制、全球定位(部分为可选包)
最后要说明的一点是Android Dalvik最终能否代替J2ME呢?Gphone之家告诉大家,Dalvik仅运行在Android平台,如果开放手机联盟真的开放了Dalvik源码可能形式有所变化,但目前gphone的对手还有强大的iphone和symbian、uiq、以及wince、palm、brew等,所以目前无法做更多评论。
Friday, January 23, 2009
cup cake build
Tuesday, January 20, 2009
Run Android Application from Command Line
转自: http://learnandroid.blogspot.com/2008/01/run-android-application-from-command.html
Sometime, we want to start the android application program from command line (Android Shell). Before, we usually clicking on the icon at application folder to run our program. So, there is an alternative way to run the program.
We use the Android Shell and issue am command to brought up the program. below is an example to do that.
1. Make sure that android emulator is running
2. Enter the shell with issuing command at command shell (prompt): adb shell
3. Issue am command. am command syntax is as follow :
am [start|instrument]
am start [-a
[-c
[-e
[-n
am instrument [-e
[-w]
for example we have android program with Manifest like below:
.
.
To run the code issue command like this (in one line):
am start -a android.intent.action.MAIN -n
com.iftitah.android.contact/com.iftitah.android.contact.Contact
ok, Have a nice try!
HOWTO Build Android-X86 Full Source
转自: http://groups.google.co.jp/group/android-porting/browse_thread/thread/66862bdb52dac936
HOWTO Build Android-X86 Full Source
====================================
Last Modified on 23-Dec-2008 23:10
I Summarized how to build android full source for x86 target.
0. My development environments
- OS : Ubuntu 8.10 Distribution ( 2.6.27-4-generic )
- CPU: Intel(R) Core(TM)2 Duo CPU T5750 @ 2.00GHz ( Samsung SENS
R60 Laptop )
- RAM: Samsung DDR Ram
- Target: Eee PC (ASUS)
1. Query of Linux distribution information
- At first, Prepare ASUS Eee 701 Lattop or Samsung nettop (NC01).
And then, confirm system information on your linux distribution
like belows.
$ uname -a
Linux invain-laptop 2.6.27-4-generic #1 SMP Wed Sep 24 01:30:51 UTC
2008 i686 GNU/Linux
$ gcc --version
gcc (Ubuntu 4.3.2-1ubuntu10) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
2. repo init and Sync
- You have to download android full source for x86 architecture like
ASUS Eee PC 701.
- Eee pc dev tree is "git://android.git.kernel.org/platform/vendor/
asus/eee_701.git".
$ cd ~
$ mkdir bin_x86 && cd bin_x86
$ mkdir mydroid && cd mydroid
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b
cupcake
$ repo sync
$ vi ./.repo/local_manifest.xml
$ repo sync
... A new repo command ( 1.8) is available.
... You should upgrade soon:
cp /home/invain/bin_x86/mydroid/.repo/repo/repo /home/invain/bin/
repo
Initializing project platform/vendor/asus/eee_701 ...
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 33 (delta 2), reused 33 (delta 2)
Unpacking objects: 100% (33/33), done.
From git://android.git.kernel.org/platform/vendor/asus/eee_701
* [new branch] cupcake -> korg/cupcake
* [new branch] master -> korg/master
3. Building x86 android full source
$ TARGET_ARCH=x86 TARGET_PRODUCT=eee_701 DISABLE_DEXPREOPT=true make -
j2 installer_img
build/core/product_config.mk:207: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=eee_701
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/main.mk:178: implicitly installing apns-conf_sdk.xml
............... Below Omission ...................
* Toouble Shooting
$ vi external/srec/tools/thirdparty/OpenFst/fst/lib/../../fst/lib/
vector-fst.h
$ vi external/srec/tools/thirdparty/OpenFst/fst/lib/symbol-table.cpp
$ vi frameworks/base/tools/aidl/aidl.cpp --> #include
#include
and so on......
$ vi
$ ls -lh out/target/product/eee_701/
total 753M
-rw-r--r-- 1 oedev oedev 2.5M 2008-12-20 21:23 boot.img
-rw-r--r-- 1 oedev oedev 57 2008-12-20 22:15 clean_steps.mk
drwxr-xr-x 4 oedev oedev 4.0K 2008-12-20 21:32 data
drwxr-xr-x 2 oedev oedev 4.0K 2008-12-20 19:54 grub
drwxr-xr-x 4 oedev oedev 4.0K 2008-12-20 22:36 installer
-rw-r--r-- 1 oedev oedev 388M 2008-12-20 22:38 installer.img
-rw-r--r-- 1 oedev oedev 1.9M 2008-12-20 18:45 kernel
drwxr-xr-x 12 oedev oedev 4.0K 2008-12-20 22:33 obj
-rw-r--r-- 1 oedev oedev 592K 2008-12-20 21:10 ramdisk.img
drwxr-xr-x 9 oedev oedev 4.0K 2008-12-20 21:09 root
drwxr-xr-x 4 oedev oedev 4.0K 2008-12-20 19:55 symbols
drwxr-xr-x 12 oedev oedev 4.0K 2008-12-20 21:29 system
-rw-r--r-- 1 oedev oedev 355M 2008-12-20 22:34 system.img
-rw-r--r-- 1 oedev oedev 5.0M 2008-12-20 21:32 userdata.img
$ file out/target/product/eee_701/installer.img
out/target/product/eee_701/installer.img: x86 boot sector;
GRand Unified Bootloader, stage1 version 0x3; partition 2:
ID=0x83, starthead 0, startsector 10926, 783672 sectors, code offset
0x48
$ file out/target/product/eee_701/system.img
out/target/product/eee_701/system.img: Linux rev 0.0 ext2 filesystem
data
$ file out/target/product/eee_701/userdata.img
out/target/product/eee_701/userdata.img: Linux rev 0.0 ext2 filesystem
data
$ sudo mount -o loop boot.img /mnt
total 2.5M
-rw-r--r-- 1 oedev oedev 77 2008-12-20 21:23 cmdline
-rw-r--r-- 1 oedev oedev 1.9M 2008-12-20 21:23 kernel
-rw-r--r-- 1 oedev oedev 592K 2008-12-20 21:23 ramdisk
$ cat /mnt/cmndline
console=tty0 console=ttyS1,115200n8 console=tty0
androidboot.hardware=eee_701
$ cp /mnt/ramdisk /tmp/ramdisk.gz
$ cd /tmp
$ gunzip ramdisk.gz
$ cpio -iv < ramdisk
sys
init.goldfish.rc
system
data
init.rc
proc
init
default.prop
sbin
sbin/adbd
init.eee_701.rc
lib
lib/modules
lib/modules/i915.ko
lib/modules/font.ko
lib/modules/drm.ko
lib/modules/cfbcopyarea.ko
lib/modules/cfbimgblt.ko
lib/modules/bitblit.ko
lib/modules/cfbfillrect.ko
lib/modules/softcursor.ko
lib/modules/fbcon.ko
lib/modules/atl2.ko
dev
2955 blocks
$ file /tmp/init
/tmp/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
statically linked, not stripped
4. Make USB Stick Installer
$ dd if=out/target/product/eee_701/installer.img of=/dev/
5. Now. Enjoy X86 Android Platform!
End of Line.
Monday, January 19, 2009
Android Cupcake源码编译笔记
转自: Android Cupcake源码编译笔记
一直在想下份Android 的源代码来编译,学习。在http://android.git.kerner.org/下了好多天都没下完,repo sync老出错,而且出错就退出,不会自动重试,
正郁闷中,发现www.androidin.com的下载恢复了,赶整下了个,还有点小大,压缩包1G,解压后将近2G,编译了一天,终于得到了3个文件:ramdisk.img,system.img
,userdata.img,现在将编译的过程记下来做个参考。
编译环境:VMware Workstation5中装ubuntu 8.10
1. 首先,要安装JDK 5或6,下载地址http://java.sun.com/javase/downloads/index.jsp,安装完后设置好JAVA环境变量。
2. 去www.androidin.com下载Android Cupcake源码
3. 解压下载的cupcake.tar.gz
4. 我的ubuntu没有安装g++,安装g++: apt-get install g++
5. 安装库文件
apt-get install flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev zlib1g-dev curl libncurses5-dev zlib1g-dev libx11-dev build-essential
python libdevice-serialport-perl imagemagick
6. 进入cupcake文件夹,make
7. 过一会,编译出错,都是却少了头文件引用,vim打开出错的文件,手动添加头文件,继续make,出错,加头文件,多次重复,大概有20次,具体数没数,不确定有多少次
报错。添加头文件要点:
提示缺strcpm,strdup等声明的,添加 #include
提示缺exit,malloc等声明的,添加 #include
提示缺sort声明的,添加 #include
提示缺unlink声明的,添加 #include
8. 我编译时,unlink是最后一处错误,改了这个后又编译了2个小时,终于结束。
编译完会产生OUT目录,要运行,好象还要make sdk,我在这一步,java库报错了,没有完成,将“ramdisk.img,system.img,userdata.img”在下载的android SDK开发包的模拟
器中可以正常运行。
Tuesday, December 23, 2008
在android平台下载和编译源代码
android的源代码下载的官方网站是:http://source.android.com
源代码的下载说明页面是:http://source.android.com/download
其实英文好的朋友大可不必看偶在此罗嗦,直接follow google的说明就行了,一切都很简单。
下面就把android platform在slackware 12.0上面的下载、编译过程汇总一下:
(1)当然了,需要安装slackware 12.0或者更高版本的linux发行版,直接选择“full”模式,完全安装。
(2)确认环境是否达到了要求,你可以在linux下面建立一个账户,然后在账户的目录下面查看是否满足如下的要求:
a)git (1.5.4或者以上版本,slackware 12.0本身就是1.5.5的)
b)python (2.4或者以上的版本,slackware 12.0本身应该是2.5的)
c)jdk5.0以上的版本,这个slackware 12.0没有,slackware只有java的运行环境而已,于是登录:
http://java.sun.com/javase/downloads
下载一个即可,我下载的是jdk5.0 update 10的版本,理论上应该越高越好吧。
然后,就用chmod a+x jdkxxxxxxx.bin,然后运行,安装到你的机器上即可。
(注:当然了,也可以直接su成root把安装包弄到/usr/local目录下面去)
然后有一个网络方面的设置需要注意,运行如下程序:
/usr/local/jdk-xxxxxxx/bin/ControlPanel
选择在network里面选择setting,然后把连接类型设置为Direct Connection。
(3)创建工作目录,进入工作目录,创建bin目录:
mkdir ~/works
mkdir ~/works/android_dev
cd ~/works/android_dev
mkdir bin
(4)下载安装repo版本管理工具
curl http://android.git.kernel.org/repo > ~/works/android_dev/bin/repo
cd bin
chmod a+x repo
(5)开始准备下载android
cd ~/works/android_dev
./bin/repo init -u git://android.git.kernel.org/platform/manifest.git
通常情况下会出现error提示(如果是以前没有创建过repo账户的话),这个不要紧,忽略掉它好了。
(6)配置repo账户
git config --global user.email "[email=xxxxx@xxxxxxx]xxxxx@xxxxxxx[/email]"
git config --global user.name "xxxxxx"
(7)开始下载android platform的源代码
repo sync
这个操作会持续一段时间,看网速了;google上面说的源代码占用2.1G的硬盘空间,但似乎没有那么大,只有900M左右。
(8)好了,现在准备一下环境变量
最好在.bashrc或者在/etc/profile文件中添加环境变量定义:
export ANDROID_JAVA_HOME=$JAVA_HOME
需要logout,再login一下,然后用:
echo $ANDROID_JAVA_HOME
命令来确认一下环境变量是否已经生效
(9)修改一个小“bug”
理论上在ubuntu上面可以直接开始编译了,但是在slackware上似乎还需要手工修改一个编译脚本上的bug,找到如下文件:
~/works/android_dev/external/sqlite/dist/Android.mk
找到下面这一行:
ifneq ($(strip $(have_readline)),)
LOCAL_LDLIBS += -lreadline
endif
这里只有一个-lreadline,对于slackware来说就不够了,编译的时候会出现 libreadline.so:undefinedreference 'PC'之类的错误。修正的方法很简单,就是直接在这一句的后面加上-lncurses,改正后应该是这个样子的:
LOCAL_LDLIBS += -lreadline -lncurses
好了,然后就可以开始放手编译了。
(10)编译
make
好了,然后就可以出去晃晃,喝杯咖啡了(足够你喝很多很多杯的咖啡)。
编译完毕以后,会发现在代码目录下多了一个目录:
~/works/android_dev/out
这就是生成的结果了,此时不要着急,需要先再设置一下环境变量方法同(8):
export ANDROID_PRODUCT_OUT=/home/wayne/works/android_dev/out/target/product/generic
设置完了以后,需要logout,再login一次才可以喔,更新环境变量。
(11)开始验证生成的结果
进入android_dev/out/host/bin/目录下,然后运行:
emulator --debug-init -skin QVGA-L [回车]
应该看到以下的画面(第一次开启的时候,应该还有一个向google反馈的一个对话框,按下确定即可):
Friday, December 19, 2008
Friday, November 28, 2008
Friday, November 7, 2008
Android核心模块及相关技术

更多精彩请到 http://www.139ya.com
转自android 开发者论坛
Android作为一个移动设备的平台,其软件层次结构包括了一个操作系统(OS),中间件(MiddleWare)和应用程序(Application)。根据Android的软件框图,其软件层次结构自下而上分为以下几个层次:
第一、操作系统层(OS)
第二、各种库(Libraries)和Android 运行环境(RunTime)
第三、应用程序框架(Application Framework)
第四、应用程序(Application)
以下分别介绍Andoid各个层次的软件的重点及其相关技术:
● 操作系统层(OS)
Android使用Linux2.6作为操作系统,Linux2.6是一种标准的技术,Linux也是一个开放的操作系统。Android对操作系统的使用包括核心和驱动程序两部分,Android的Linux核心为标准的Linux2.6内核,Android更多的是需要一些与移动设备相关的驱动程序。主要的驱动如下所示:
显示驱动(Display Driver):常用基于Linux的帧缓冲(Frame Buffer)驱动。
Flash内存驱动(Flash Memory Driver)
照相机驱动(Camera Driver):常用基于Linux的v4l(Video for )驱动。
音频驱动(Audio Driver):常用基于ALSA(Advanced Linux Sound Architecture,高级Linux声音体系)驱动。
WiFi驱动(Camera Driver):基于IEEE 802.11标准的驱动程序
键盘驱动(KeyBoard Driver)
蓝牙驱动(Bluetooth Driver)
Binder IPC驱动: Andoid一个特殊的驱动程序,具有单独的设备节点,提供进程间通讯的功能。
Power Management(能源管理)
● 各种库(Libraries)和Android 运行环境(RunTime)
本层次对应一般嵌入式系统,相当于中间件层次。Android的本层次分成两个部分一个是各种库,另一个是Android 运行环境。本层的内容
大多是使用C++实现的。
在其中,各种库包括:
▅ C库 :C语言的标准库,这也是系统中一个最为底层的库,C库是通过Linux的系统调用来实现。
▅ 多媒体框架(MediaFrameword):这部分内容是Android多媒体的核心部分,基于PacketVideo(即PV)的OpenCORE,从功能上本库一共
分为两大部分,一个部分是音频、视频的回放(PlayBack),另一部分是则是音视频的纪录(Recorder)。
▅ SGL:2D图像引擎。
▅ SSL:即Secure Socket Layer位于TCP/IP协议与各种应用层协议之间,为数据通讯提供安全支持。
▅ OpenGL ES 1.0 :本部分提供了对3D的支持。
▅ 界面管理工具(Surface Management):本部分提供了对管理显示子系统等功能。
▅ SQLite:一个通用的嵌入式数据库
▅ WebKit:网络浏览器的核心
▅ FreeType:位图和矢量字体的功能。
Android 的各种库一般是以系统中间件的形式提供的,它们均有的一个显著特点就是与移动设备的平台的应用密切相关。
Android 运行环境主要指的虚拟机技术——Dalvik。Dalvik虚拟机和一般JAVA虚拟机(Java VM)不同,它执行的不是JAVA标准的字节码(bytecode )而是Dalvik可执行格式(.dex)中执行文件。在执行的过程中,每一个应用程序即一个进程(Linux的一个Process)。 二者最大的区别在于Java VM是以基于栈的虚拟机(Stack-based),而Dalvik是基于寄存器的虚拟机(Register-based)。显然,后者最大的好处在于可以根据硬件实现更大的优化,这更适合移动设备的特点。
● 应用程序框架(Application Framework)
Android的应用程序框架为应用程序层的开发者提供APIs,它实际上是一个应用程序的框架。由于上层的应用程序是以JAVA构建的,因此本
层次提供的首先包含了UI程序中所需要的各种控件:
例如: Views (视图组件)包括 lists(列表), grids(栅格), text boxes(文本框), buttons(按钮)等。甚至一个嵌入式的Web浏览器。
一个Andoid的应用程序可以利用应用程序框架中的以下几个部分:
Activity (活动)
Broadcast Intent Receiver (广播意图接收者)
Service (服务)
Content Provider (内容提供者)
● 应用程序(Application)
Android的应用程序主要是用户界面(User Interface)方面的,通常以JAVA程序编写,其中还可以包含各种资源文件(放置在res目录中)JAVA程序及相关资源经过编译后,将生成一个 APK包。Android本身提供了主屏幕(Home),联系人(Contact),电话(Phone),浏览器(Browers)等众多的核心应用。同时应用程序的开发者还可以使用应用程序框架层的API实现自己的程序。这也是Android开源的巨大潜力的体现。
Android emulator how to
http://tungchingkai.blogspot.com/2008/09/how-to-android-emulator.html
(1) How to install emulator only (that is no JDK, Eclipse IDE or compiler)
(a) Download Android SDK from
http://code.google.com/android/download_list.html
The current version is
android-sdk-windows-1.0_r1.zip (windows)
android-sdk-linux_x86-1.0_r1.zip (linux)
unzip it and put the folder (android-sdk-windows-1.0_r1) to say under
Windows OS
D:\Android\
Linux / Mac OS X
~/Android/
(b) start the emulator in command windows (windows-R -> cmd) / (Linux/Mac OS X -> Terminal) for the first time to setup data directory
Windows OS
D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
emulator -datadir D:\Android
Linux / Mac OS X
cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./emulator -datadir ~/Android
(2) How to create sdcard for emulator (e.g. 500M)
e.g. To create a sdcard image of 500M with filename sd500m.img
Windows OS
D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
mksdcard -l SD500M 500M D:\Android\sd500m.img
Linux / Mac OS X
cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./mksdcard -l SD500M 500M ~/Android/sd500m.img
when starting the emulator and adding -sdcard option
Windows OS
D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
emulator -sdcard D:\Android\sd500m.img [.... other options]
Linux / Mac OS X
cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./emulator -sdcard ~/Android/sd500m.img [.... other options]
(3) How to scale the emulator size when the emulator screen is out of view of your computer
when starting the emulator and adding -scale option (range from 0.1 to 3)
e.g. start the emulator with a scale of 0.5
Windows OS
D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
emulator -scale 0.5 [.... other options]
Linux / Mac OS X
cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./emulator -scale 0.5 [.... other options]
(4) How to copy Musics and Pictures to the sdcard image for Android emulator
The sdcard image is a FAT32 image. You just double click the file in Mac OSX to mount it.
Inside it, create folders called Musics and Pictures and put your mp3 files and pictures as per screen dump below
(5) How to copy files to sdcard while the emulator is running or when you cannot mount it.
You can mount the sdcard image while the emulator is running, but sometimes you want to copy files to the sdcard in command line mode run this
Make Sure that the emulator is running
Windows OS
D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
adb push mynotebookphoto.png sdcard/Pictures/
Linux / Mac OS X
cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./adb push mynotebookphoto.png sdcard/Pictures/
However, the emulator will need to restart so that it can acknowledge the new file. This is currently the limitation of the emulator
when copying back from emulator sdcard to local file
Windows OS
D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
adb pull sdcard/Pictures/image01.jpg images01_fromsdcard.jpg
Linux / Mac OS X
cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./adb pull sdcard/Pictures/image01.jpg images01_fromsdcard.jpg
(6) How to get shell access to emulator
The emulator must be running, and run this
Windows OS
D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
adb shell
Linux / Mac OS X
cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./adb shell
(7) How to add path of the emulator tools directory to Windows OS, so as no need to change directory to sdk directory
On Windows, right click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path under System Variables and add this to end of the text
Windows OS
D:\Android\android-sdk-windows-1.0_r1\tools;
Please take note that you have to restart the command window for the path to become effective
(8) How to change skin for the emulator
You can download some iPhone skins for Android emulator here
http://www.anddev.org/emulator_iphone_skin_-_qvga-hvga_landscape-portrait-t109.html
(9) How to change wallpaper, add new icons to homescreen and move/delete icons.
At Home Screen, press Menu
+ Add -> for adding icons to home screen
Wallpaper -> to change wallpaper
You can flip the homescreen to left and right and add icons there
To delete the icon just click and hold the button and a trash will appear above the menu button then you can drag the icon to the trash and delete it
To move the icon, click and hold the icon and then drag to new position.
Monday, November 3, 2008
android
安卓网 : http://91android.com/bbs/
高焕唐
Quick Android Dev Tips
Android mksdcardhttp://www.android-internals.org
Android源码构建工具速览
在android平台下载和编译源代码
This Blog is dedicated for Learning Android, Android Platform
Share Code Experiment's Result
Welcome the Android Internals wiki : http://www.android-internals.org/index.php?title=Main_Page
building-android-source-and-deploying : http://www.koushikdutta.com/2008/12/building-android-source-and-deploying.html
Android build system: http://www.kandroid.org/android_pdk/build_system.html
