sudo vi /usr/lib/gtk-2.0/2.10.0/immodule-files.d/gcin.immodules
"gcin" "gcin Input Method" "gcin" "/usr/share/locale" "" <- 最後面本來是 "*" 把*拿掉
Tuesday, August 17, 2010
Wednesday, August 11, 2010
Tuesday, August 10, 2010
illegal forware reference in java
case 1: 比較常見的
class Test {
String s = "hello";
class inner {
inner () {
String s = s; // <- illegal forward reference
}
}
}
case 2: 比較特別的 即使sStr是static也會
class Test2 {
static {
System.out.println(sStr); // <- illegal forward reference
}
private static String sStr = "hello World";
}
class Test {
String s = "hello";
class inner {
inner () {
String s = s; // <- illegal forward reference
}
}
}
case 2: 比較特別的 即使sStr是static也會
class Test2 {
static {
System.out.println(sStr); // <- illegal forward reference
}
private static String sStr = "hello World";
}
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
Wednesday, July 21, 2010
在dalvik跟v8中把jit code印出來
dalvik
mydroid/dalvik/vm/Init.c
see gDvmJit.printMe = true;
v8
mydroid/external/v8/src/flag-definitions.h
print_code
print_builtin_code
mydroid/dalvik/vm/Init.c
see gDvmJit.printMe = true;
v8
mydroid/external/v8/src/flag-definitions.h
print_code
print_builtin_code
Wednesday, July 14, 2010
在mydroid build D8
這篇有問題 是錯的
後來發現 d8 中JS2C要的是
把d8.js 轉成d8-js.cc
原因是d8.cc裡面用的是NativesCollection
而這就在產生的d8-js.cc裡
# ===================================================
LOCAL_MODULE := d8
LOCAL_MODULE_CLASS := EXECUTABLES
intermediates := $(call local-intermediates-dir)
include $(LOCAL_PATH)/Android.v8common.mk
LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/,1 $(V8_LOCAL_JS_LIBRARY_FILES))
# Copy js2c.py to intermediates directory and invoke there to avoid generating
# jsmin.pyc in the source directory
JS2C_PY := $(intermediates)/js2c.py $(intermediates)/jsmin.py
$(JS2C_PY): $(intermediates)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP)
@echo "Copying $@"
$(copy-file-to-target)
# Generate libraries.cc
GEN3 := $(intermediates)/libraries-d8.cc $(intermediates)/libraries-d8-empty.cc
$(GEN3): SCRIPT := $(intermediates)/js2c.py
$(GEN3): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY)
@echo "Generating XXXX libraries.cc"
@mkdir -p $(dir $@)
python $(SCRIPT) $(GEN3) D8 $(LOCAL_JS_LIBRARY_FILES)
V8_GENERATED_LIBRARIES := $(intermediates)/libraries-d8-empty.cc
LOCAL_GENERATED_SOURCES += $(V8_GENERATED_LIBRARIES)
LOCAL_SRC_FILES := src/d8.cc src/d8-debug.cc src/d8-posix.cc
LOCAL_CFLAGS := -DENABLE_DEBUGGER_SUPPORT
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DARM -DV8_TARGET_ARCH_ARM
endif
LOCAL_C_INCLUDES := bionic/libc/include $(LOCAL_PATH)/src $(LOCAL_PATH)/include
LOCAL_CPP_EXTENSION := .cc
LOCAL_STATIC_LIBRARIES := libv8
LOCAL_SHARED_LIBRARIES := libcutils
include $(BUILD_EXECUTABLE)
後來發現 d8 中JS2C要的是
把d8.js 轉成d8-js.cc
原因是d8.cc裡面用的是NativesCollection
而這就在產生的d8-js.cc裡
# ===================================================
LOCAL_MODULE := d8
LOCAL_MODULE_CLASS := EXECUTABLES
intermediates := $(call local-intermediates-dir)
include $(LOCAL_PATH)/Android.v8common.mk
LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/,1 $(V8_LOCAL_JS_LIBRARY_FILES))
# Copy js2c.py to intermediates directory and invoke there to avoid generating
# jsmin.pyc in the source directory
JS2C_PY := $(intermediates)/js2c.py $(intermediates)/jsmin.py
$(JS2C_PY): $(intermediates)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP)
@echo "Copying $@"
$(copy-file-to-target)
# Generate libraries.cc
GEN3 := $(intermediates)/libraries-d8.cc $(intermediates)/libraries-d8-empty.cc
$(GEN3): SCRIPT := $(intermediates)/js2c.py
$(GEN3): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY)
@echo "Generating XXXX libraries.cc"
@mkdir -p $(dir $@)
python $(SCRIPT) $(GEN3) D8 $(LOCAL_JS_LIBRARY_FILES)
V8_GENERATED_LIBRARIES := $(intermediates)/libraries-d8-empty.cc
LOCAL_GENERATED_SOURCES += $(V8_GENERATED_LIBRARIES)
LOCAL_SRC_FILES := src/d8.cc src/d8-debug.cc src/d8-posix.cc
LOCAL_CFLAGS := -DENABLE_DEBUGGER_SUPPORT
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DARM -DV8_TARGET_ARCH_ARM
endif
LOCAL_C_INCLUDES := bionic/libc/include $(LOCAL_PATH)/src $(LOCAL_PATH)/include
LOCAL_CPP_EXTENSION := .cc
LOCAL_STATIC_LIBRARIES := libv8
LOCAL_SHARED_LIBRARIES := libcutils
include $(BUILD_EXECUTABLE)
Subscribe to:
Posts (Atom)