2011年11月16日 星期三

[操作] Android Emulator

- Emulator Image的Project如何新增?
到build/target/product/full_base.mk 新增自己的Package

- 如何丟apk抽換/system/app下的apk
調整emulator的image大小, 避免Out of Memory問題
emulator -avd NAME -partition-size 512

設定 partition可寫入 , 避免 Read-only的問題
adb remount

ICS注意要將apk與odex一同丟入emulator中

[技術] How to install a untrusted root certificate to android emulator

很玄的文章 , 應該有用途 , 記錄下來
http://www.virgo81.net/70

2011年11月15日 星期二

[主機] Ubuntu

Ubuntu預設將root關閉 , 可透過下列方式設定root密碼

sudo passwd root

2011年11月10日 星期四

[原始碼] Android Contacts

Contacts Clound
http://gigaom.com/mobile/how-to-use-the-cloud-to-move-contacts-between-phones/


Android Contact数据模型之EntityDelta
http://www.cnblogs.com/yyq-quan/archive/2011/09/01/2162332.html
http://www.cnblogs.com/yyq-quan/archive/2011/09/01/2162343.html
添加联系人的界面如何去得到用户在文本框里输入的文字? http://www.iteye.com/problems/57473


Entity
包含下列三個元素 , 對應到Contacts的資料表分別為:
Top Level
- Content Value <==> 特定RawContacts Table資料的各欄位資料
SubValue
- Uri <==> 對應到RawContacts的所有Data Table的URI
- Content Value <==> 對應到RawContacts的所有Data Table 欄位資料

ContentValues getEntityValues() <==> 取得特定RawsContacts Table的所有欄位資料
ArrayList<Entity.NamedContentValues> getSubValues() <==> 取得對應RawContacts Table id的
Data Table 資料的欄位

Entity.NamedContentValues

保存下列兩個欄位 , 用來描述特定Contacts Data欄位的內容
- URI (Data欄位的Uri)
- Cotent Value

2011年11月8日 星期二

[技術] Ordered Broadcasts

http://blog.csdn.net/ruijc/article/details/6210024

在Not-ordered模式,系统的Broadcasts是同时发布出来,所有receiver都可以得到该事件信息,互相并不影响。即,一个receiver不能影响其它receivers是否能获得该事件信息。上面电池的 ACTION_BATTERY_LOW 就是属于not-ordered事件。

在ordered模式
,broadcasts是通过优先设置传达给不同receivers的,优先度在AndroidManifest文件中通过android:priority的intent-filter设置控制的。某个receiver可以通过BroadcastReceiver取消broadcast,取消后,比它优先度底的receivers将不再能得到该broadcast。一个典型的例子是,ACTION_NEW_OUTGOING_CALL。

[Fragment] 技術用法

設定TagetFragment
final SelectAccountDialogFragment dialog = new SelectAccountDialogFragment();
 dialog.setTargetFragment(this, 0);
呼叫TargetFragment的function

final Listener target = (Listener) getTargetFragment();
 target.onAccountChosen(accountAdapter.getItem(which));