Wednesday, June 29, 2011

android:launchMode

[Android] android:launchMode (standard、singleTop、singleTask、singleInstance)
http://jiunway.blogspot.com/2010/10/android-androidlaunchmode_26.html

standard, no reuse activity
singleTop, reuse activity if the same as the toppest activity
singleTask, reuse the same activity on the activity stack
singleInstance, reuse the same activity across multiple processes

Monday, April 11, 2011

[Android] ndk stl build

終於知道如何用ndk-build stl
doc中說可以在Android.mk[x]中設定變數, 不過不成功.

--> 原來是看錯檔名 應該是Application.mk才對
--> 加一個Application.mk就可以build

[x] 後來下在command中:
[x] ndk-build APP_STL=stlport_static

其中 APP_STL 可以有幾個選擇
system -> Use the default minimal C++ runtime library.
stlport_static -> Use STLport built as a static library.
stlport_shared -> Use STLport built as a shared library.
gnustl_static -> Use GNU libstdc++ as a static library.

gnu多了exception.

Tuesday, January 18, 2011

[Android] remote debug android process

發現一個不錯的功能可以remote debug android process
連 system_server 也可以debug.
在eclipse中切換到ddms的頁面

最右邊的欄位就是remote debug的 port number
切到 Debug 頁面, 選 "Debug Configuration..."
新增一個 "Remote Java Application" 選項
選擇你的project & 填上 port number 就可以用了

Wednesday, January 12, 2011

Android中的LIKELY和UNLIKELY

這篇解釋的不錯
http://blog.csdn.net/DroidPhone/archive/2010/11/03/5984255.aspx

if(LIKELY(exp)) 就是告訴compiler這個if branch較常執行, 可以針對他作優化
if(UNLIKELY(exp)) 相反則是以else branch為優化的對象.

Tuesday, January 4, 2011

[Android] Surface Flinger

article about SurfaceFlinger

Android Display System --- Surface Flinger
http://blog.csdn.net/yili_xie/archive/2009/11/12/4803527.aspx

Android GUI更新过程
http://www.limodev.cn/blog/archives/1582

Android中的FrameBuffer
http://www.limodev.cn/blog/archives/1586

Sunday, December 12, 2010

[webkit] css property names

webkit裡頭有許多自訂的css, 有人把他整理了一下
http://qooxdoo.org/documentation/general/webkit_css_styles

css name是定義在 webkit/WebCore/css 中的 *.in (ex: CSSPropertyNames.in)
然後透過makeprop.pl轉成.h & .cpp, 定義出string與int constant的mapping

我猜程式裡再拿這些常數來用.

Wednesday, December 8, 2010

[Android] 為什麼找不到 /etc/group ?

今天在找權限的時候 發現android並沒有 passwd & group 這兩個檔.
上網找了好久 才發現這篇
http://groups.google.com/group/android-ndk/browse_thread/thread/adddb27c1a5438e9

原來 bionic/libc/bionic/stubs.c 裡頭將user/group name to id 重新寫過
改成用 system/core/include/private/android_filesystem_config.h 裡頭的android_ids,
每個id是user 也是group, 所以就沒有/etc/passwd這兩個檔了.