2011年5月20日

Adb 可經由網路連線

Debugging considerations


When debugging applications that use USB accessory or host features, you most likely will have USB hardware connected to your Android-powered device. This will prevent you from having an adb connection to the Android-powered device via USB. You can still access adb over a network connection. To enable adb over a network connection:

2011年2月24日

利用ELF header保護程式

If you want to prevent your binary program from being executed on other platform, you can try this way.

2011年1月28日

Android input binary tool

Android 有個小程式可以模擬鍵盤操作
用法如下:
輸入字串
adb shell input text "ANDROID"
如果要輸入WiFi密碼是還不錯用,有些符號不行,如"#"
點擊螢幕上任一點
Input touchscreen tap x y
滑動至另一點
Input touchscreen swipe x1 y 1 x2 y2
輸入 keyevent
adb shell input keyevent 29    # for key 'A'

2010年6月3日

調用freopen,把標準輸出導向

Debug的時候,把標準輸出導向是一個不錯的選擇,尤其寫daemon或service的時候。

http://www.cplusplus.com/reference/clibrary/cstdio/freopen/

2010年5月24日

查看usb device firmware 版本

#lsusb -d 04f2: -v | grep bcdDevice
其中04f2 為 device id,各家不同.

2010年5月4日

virtual user input


如果想模擬使用者操作滑鼠、鍵盤等輸入裝置,可利用二種方式:xdotool或uinput,以下分別介紹。

2010年4月26日

GDBM /NDBM 資料庫

GDBM - The GNU database manager,一套簡單的資料庫管理函數。

dbm 是 UNIX 上一套古老的常見資料庫處理介面,而 ndbm 則是改良 dbm 缺失而設計的,兩者的介面差異頗大。gdbm 則是根據ndbm 的介面設計的,兩者間非常相似, ndbm 的函數名稱皆以 dbm_ 開頭,而 gdbm 為了加以區別,則以 gdbm_ 開頭,並且利用hash 表存放鍵值,大幅節省搜尋時間,除此之外,皆可對應。其資料庫主要利用每一筆資料都有一對"鍵值"及"內容"。利用鍵值做三個動作{storing 儲存,retrieval 擷取,deletion 刪除}資料。