在cat /proc/meminfo下 ram總是90多MB
看了一下 qemu的source
原來是在 externel/qemu/android/avd/hardware-properties.ini 設定的
default是 96MB
Showing posts with label android_emulator. Show all posts
Showing posts with label android_emulator. Show all posts
Friday, November 4, 2011
Friday, February 11, 2011
Android webkit裡的GIF Animation
大家一直在吵說android的webkit到底有沒有support animate GIF
有的人說有 有的人說沒有
雖然在config.h 裡 是有define ANDROID_ANIMATED_GIF
但其實關鍵是在ANDROID_LARGE_MEMORY_DEVICE
而這個option只有在比較後面的device 才有enable, 像nexus one
http://android.git.kernel.org/?p=platform/external/webkit.git;a=blob;f=Android.mk;h=21f6cf4e8b7d65479cbeb741f63a17b2d94f8238;hb=HEAD#l242
而android emulator上 並不會enable這個option
參考
http://allstarschh.blogspot.com/2010/11/default-javascript-engine-on-froyo.html
所以就目前Android 2.3上只有在device上才能看到animated GIF emulator上不行
如果一定想要在emulator上跑的話
就要自己enable ANDROID_LARGE_MEMORY_DEVICE 這個option了
有的人說有 有的人說沒有
雖然在config.h 裡 是有define ANDROID_ANIMATED_GIF
但其實關鍵是在ANDROID_LARGE_MEMORY_DEVICE
而這個option只有在比較後面的device 才有enable, 像nexus one
http://android.git.kernel.org/?p=platform/external/webkit.git;a=blob;f=Android.mk;h=21f6cf4e8b7d65479cbeb741f63a17b2d94f8238;hb=HEAD#l242
而android emulator上 並不會enable這個option
參考
http://allstarschh.blogspot.com/2010/11/default-javascript-engine-on-froyo.html
所以就目前Android 2.3上只有在device上才能看到animated GIF emulator上不行
如果一定想要在emulator上跑的話
就要自己enable ANDROID_LARGE_MEMORY_DEVICE 這個option了
Monday, November 15, 2010
the default Javascript engine on froyo emulator
大家都以為到了froyo, Webkit就default 使用 V8 來作javascript engine了
但其實在emulator裡 還是使用 JavascriptCore來作JavaScript engine
先看
http://android.git.kernel.org/?p=platform/external/webkit.git;a=blob;f=Android.mk;h=4390cf32121dc7de380b8d1fc655c48228e4e502;hb=HEAD#l48
要在 ARCH_ARM_HAVE_VFP 有被defined時 default js engine才是v8
emulator default是用armv5-te的cpu
http://android.git.kernel.org/?p=platform/build.git;a=blob;f=core/combo/TARGET_linux-arm.mk;h=f998cf44b7f7e6eebafefa97500cae12c0bf57d2;hb=HEAD#l34
而armv5-te的makefile裡 並沒有enable ARCH_ARM_HAVE_VFP
http://android.git.kernel.org/?p=platform/build.git;a=blob;f=core/combo/arch/arm/armv5te.mk;h=29aada6d9c52d08a3d8b7c4fac46d78f5b99f694;hb=HEAD
在這個post裡說明了為什麼emulator 還是用armv5而不是用armv7
http://groups.google.com/group/android-ndk/browse_thread/thread/a19fc6df3d661d79/b063b388744fa0ee?hl=en&lnk=gst&q=armv7#b063b388744fa0ee
但其實在emulator裡 還是使用 JavascriptCore來作JavaScript engine
先看
http://android.git.kernel.org/?p=platform/external/webkit.git;a=blob;f=Android.mk;h=4390cf32121dc7de380b8d1fc655c48228e4e502;hb=HEAD#l48
要在 ARCH_ARM_HAVE_VFP 有被defined時 default js engine才是v8
emulator default是用armv5-te的cpu
http://android.git.kernel.org/?p=platform/build.git;a=blob;f=core/combo/TARGET_linux-arm.mk;h=f998cf44b7f7e6eebafefa97500cae12c0bf57d2;hb=HEAD#l34
而armv5-te的makefile裡 並沒有enable ARCH_ARM_HAVE_VFP
http://android.git.kernel.org/?p=platform/build.git;a=blob;f=core/combo/arch/arm/armv5te.mk;h=29aada6d9c52d08a3d8b7c4fac46d78f5b99f694;hb=HEAD
在這個post裡說明了為什麼emulator 還是用armv5而不是用armv7
http://groups.google.com/group/android-ndk/browse_thread/thread/a19fc6df3d661d79/b063b388744fa0ee?hl=en&lnk=gst&q=armv7#b063b388744fa0ee
Friday, July 30, 2010
android emulator support
SMS
- external/qemu/telephony/modem_driver.c
see http://developer.android.com/guide/developing/tools/emulator.html#sms for usage
MMS
- N/A
Geolocation/GPS
- external/qemu/android/gps.[c|h]
- how to set
- ddms :
Emulator Control -> Location Controls -> {Manual, GPX, KML}
- shell:
$>telnet localhost
gps fix
Sensor
emulator has defined 4 sensors
- acceleration
- magnetic_field
- orientation
- temperature
only accelerometer is enable, others need to be tested
see external/qemu/android/hw-sensors.[c|h]
external/qemu/android/avd/hardware-properties.ini
for the changing orientation in emulator( Ctrl + F11),
Android framework computes the orientation by looking at the accelerometer
see external/qemu/android/hw-sensors.c _hwSensors_setCoarseOrientation
for the measure units, see hardware/libhardware/include/hardware/sensors.h
Camera
it forks a preview thread, and keeps generating a YUV422 SurfaceView
see
- frameworks/base/camera/libcameraservice/FakeCameara.[cpp|h]
- frameworks/base/camera/libcameraservice/CameraHardwareStub.[cpp|h]
to modify it to generate different preview screen
Vibration
not implemented in emulator
external/qemu/android/hw-control.c # hw_control_do_query only handles power:light:brightness
and see /sys/class/timed_output/vibrator/enable on device
Backlight
- external/qemu/android/hw-control.c
there are 3 kinds of backlight:
- lcd_backlight
- keyboard_backlight
- button_backlight
but 'Documents' says only lcd_backlight is supported
see extenal/qemu/docs/ANDROID-QEMUD-SERVICES.TXT #hw-control services
but actually even lcd_backlight can not work
because hardware module 'LIGHTS_HARDWARE_MODULE_ID' is only available when
TARGET_BOARD_PLATFORM is msm7k or qsd8k_dirs
see hardware/
also see /sys/class/leds on device
Battery Level
the implementation is in external/qemu/hw/goldfish_battery.c
- adb shell dumpsys battery
also it will create a file /sys/class/power_supply/battery on device
Signal Strength
the implementation is in external/qemu/telephony/android_modem.c
see the line
'{ "+CSQ", "+CSQ: 7,99", NULL }, /* XXX: TODO: implement variable signal strength and error rates */'
modify 7 to change to signal strength
CPU frequency
N/A
but we can get cpu usage by issuing adb
- adb shell dumpsys cpuinfo
before cupcake, in Development.apk, there's a option for displaying cpu usage on screen,
but this isn't supported anymore
see frameworks/base/libs/surfaceflinger/SurfaceFlinger.cpp #SurfaceFlinger::onTransact
- external/qemu/telephony/modem_driver.c
see http://developer.android.com/guide/developing/tools/emulator.html#sms for usage
MMS
- N/A
Geolocation/GPS
- external/qemu/android/gps.[c|h]
- how to set
- ddms :
Emulator Control -> Location Controls -> {Manual, GPX, KML}
- shell:
$>telnet localhost
gps fix
Sensor
emulator has defined 4 sensors
- acceleration
- magnetic_field
- orientation
- temperature
only accelerometer is enable, others need to be tested
see external/qemu/android/hw-sensors.[c|h]
external/qemu/android/avd/hardware-properties.ini
for the changing orientation in emulator( Ctrl + F11),
Android framework computes the orientation by looking at the accelerometer
see external/qemu/android/hw-sensors.c _hwSensors_setCoarseOrientation
for the measure units, see hardware/libhardware/include/hardware/sensors.h
Camera
it forks a preview thread, and keeps generating a YUV422 SurfaceView
see
- frameworks/base/camera/libcameraservice/FakeCameara.[cpp|h]
- frameworks/base/camera/libcameraservice/CameraHardwareStub.[cpp|h]
to modify it to generate different preview screen
Vibration
not implemented in emulator
external/qemu/android/hw-control.c # hw_control_do_query only handles power:light:brightness
and see /sys/class/timed_output/vibrator/enable on device
Backlight
- external/qemu/android/hw-control.c
there are 3 kinds of backlight:
- lcd_backlight
- keyboard_backlight
- button_backlight
but 'Documents' says only lcd_backlight is supported
see extenal/qemu/docs/ANDROID-QEMUD-SERVICES.TXT #hw-control services
but actually even lcd_backlight can not work
because hardware module 'LIGHTS_HARDWARE_MODULE_ID' is only available when
TARGET_BOARD_PLATFORM is msm7k or qsd8k_dirs
see hardware/
also see /sys/class/leds on device
Battery Level
the implementation is in external/qemu/hw/goldfish_battery.c
- adb shell dumpsys battery
also it will create a file /sys/class/power_supply/battery on device
Signal Strength
the implementation is in external/qemu/telephony/android_modem.c
see the line
'{ "+CSQ", "+CSQ: 7,99", NULL }, /* XXX: TODO: implement variable signal strength and error rates */'
modify 7 to change to signal strength
CPU frequency
N/A
but we can get cpu usage by issuing adb
- adb shell dumpsys cpuinfo
before cupcake, in Development.apk, there's a option for displaying cpu usage on screen,
but this isn't supported anymore
see frameworks/base/libs/surfaceflinger/SurfaceFlinger.cpp #SurfaceFlinger::onTransact
Monday, April 12, 2010
android emulator的cpu
http://groups.google.com/group/android-ndk/browse_thread/thread/b41d13b517abe69d?hl=en
不知道中間Dave Buther講的這段話
On the emulator I suspect it is being (correctly) treated as an
UNDEFINED instruction (the emulator is running as an ARM926 I
believe), under user-mode on an ARM1176 or an ARMv7-a processor it
will still be treated as an UNDEFINED
while in user mode.
是什麼意思............
不知道中間Dave Buther講的這段話
On the emulator I suspect it is being (correctly) treated as an
UNDEFINED instruction (the emulator is running as an ARM926 I
believe), under user-mode on an ARM1176 or an ARMv7-a processor it
will still be treated as an UNDEFINED
while in user mode.
是什麼意思............
Wednesday, October 28, 2009
mydroid 找不到sdcard
今天發現我從mydroid build出來的emulator一直mount 不到sdcard
最後發現 我的 /etc/沒有 vold.conf這檔案
然後就把 mydroid/development/data/etc/vold.conf copy 到
out/target/product/generic/system/etc下
然後make systemimage
我可以mount到sdcard了!!!
~
~
~
最後發現 我的 /etc/沒有 vold.conf這檔案
然後就把 mydroid/development/data/etc/vold.conf copy 到
out/target/product/generic/system/etc下
然後make systemimage
我可以mount到sdcard了!!!
~
~
~
Tuesday, September 15, 2009
在Android emulator 上改userdata system 的image max size
之前被問到userdata image要如何改大小
花了很多時間才找到XD
首先從Android build system講起
在mydroid/build/core/definitions.mk裡
有個
define assert-max-file-size的 function
原本以為只要指定
BOARD_FLASH_BLOCK_SIZE 跟BOARD_USERDATAIMAGE_MAX_SIZE
就可以了
但發現他這只是作個檢查的動作而已
不過他這有講到 /proc/mtd的東西
然後看了其他的code
也都是去讀 /proc/mtd 來作partition
dev: size erasesize name
mtd0: 04000000 00020000 "system"
mtd1: 04000000 00020000 "userdata"
mtd2: 04000000 00020000 "cache
然後去checkout android linux kernel的code
下載完首先要switch 到有goldfish的branch
不然預設是msm 裡面沒有goldfish的driver 編kernel也會有error
會跳到linux kernel裡面看的原因是有的embedded linux
會把mtd 的size name 等的information寫在 /drivers/mtd/map下
一個叫mtd_parition的struct裡
在drivers/mtd/devices/goldfish_nand.c下 有看到設定size的code
但他也是從memory中讀值出來而已
static int goldfish_nand_init_device(struct goldfish_nand *nand, int id)
看mtd->size
但是其他的地方都找不到設定size的地方
後來又跳到emulator的source裡看(mydroid/external/qemu)
首先發現了qemu可以讓你指定nand
"-nand name[,readonly][,size=size][,pagesize=size][,extrasize=size][,erasepages=pages][,initfile=file][,file=file]"
然後發現
android在emulator的options裡有加讓你設定nand size的option
-partition-size system/data partition size in MBs
所以 結論就是
在emulator後面加上 -partition-size 就可以設定system userdata image的大小了
# cat /proc/mtd
dev: size erasesize name
mtd0: 07c20000 00020000 "system"
mtd1: 07c20000 00020000 "userdata"
mtd2: 04000000 00020000 "cache"
花了很多時間才找到XD
首先從Android build system講起
在mydroid/build/core/definitions.mk裡
有個
define assert-max-file-size的 function
原本以為只要指定
BOARD_FLASH_BLOCK_SIZE 跟BOARD_USERDATAIMAGE_MAX_SIZE
就可以了
但發現他這只是作個檢查的動作而已
不過他這有講到 /proc/mtd的東西
然後看了其他的code
也都是去讀 /proc/mtd 來作partition
dev: size erasesize name
mtd0: 04000000 00020000 "system"
mtd1: 04000000 00020000 "userdata"
mtd2: 04000000 00020000 "cache
然後去checkout android linux kernel的code
下載完首先要switch 到有goldfish的branch
不然預設是msm 裡面沒有goldfish的driver 編kernel也會有error
會跳到linux kernel裡面看的原因是有的embedded linux
會把mtd 的size name 等的information寫在 /drivers/mtd/map下
一個叫mtd_parition的struct裡
在drivers/mtd/devices/goldfish_nand.c下 有看到設定size的code
但他也是從memory中讀值出來而已
static int goldfish_nand_init_device(struct goldfish_nand *nand, int id)
看mtd->size
但是其他的地方都找不到設定size的地方
後來又跳到emulator的source裡看(mydroid/external/qemu)
首先發現了qemu可以讓你指定nand
"-nand name[,readonly][,size=size][,pagesize=size][,extrasize=size][,erasepages=pages][,initfile=file][,file=file]"
然後發現
android在emulator的options裡有加讓你設定nand size的option
-partition-size
所以 結論就是
在emulator後面加上 -partition-size 就可以設定system userdata image的大小了
# cat /proc/mtd
dev: size erasesize name
mtd0: 07c20000 00020000 "system"
mtd1: 07c20000 00020000 "userdata"
mtd2: 04000000 00020000 "cache"
Subscribe to:
Posts (Atom)