Software entities (class, modules, functions, etc.) should be open for extension, but closed for modification. Junior programmers create simple solutions to simple problems. Senior programmers create complex solutions to complex problems. Great programmers find simple solutions to complex problems. 註1:本部落格的範例程式碼在 2015 年以前的文章中,大多是以全型空白做縮排。如需服用,請自行用文字編輯器的取代功能把全型空白取代成半型空白。
- Bertrand Meyer
- Charles Connell
註2:本部落格的內容授權請參閱部落格底部的授權宣告。
2013年5月20日 星期一
關於 Android 的 BroadcaseReceiver (1)
而要偵測到系統的通知,就必須先對系統註冊 BroadcastReceiver 事件。
2012年8月16日 星期四
(暫存) 在一個 App 當中呼叫另一個 App 的函式
一個是前端的 UI,另一個是後端處理的 API
所以先記錄一下呼叫別的 App 的 API 的方法~
1、How to call one android application from another android application
2012年8月8日 星期三
2012年8月2日 星期四
2012年7月18日 星期三
(暫存) Android HTTP POST
1、http://www.wikihow.com/Execute-HTTP-POST-Requests-in-Android
2、[Android] 使用HTTP的POST方式和網頁表單溝通
2012年7月14日 星期六
(暫存) 實現像 Google Play 那樣左右滑動換頁的方法
2012年7月8日 星期日
2012年6月28日 星期四
Desire Z 刷 ICS ROM
不過用起來實在太頓了,所以後來想說乾脆放棄 HTC Sense,找看看別的 ROM
因此這次選上了今天才剛進入 RC 的 CyanogenMod 9.0.0-RC1
圖片來源:xda-developers
2012年5月11日 星期五
申請 Amazon Appstore 的帳號
嗯,一句話點明為什麼會想要申請 Amazon Appstore 的帳號 XD
之前曾經有中斷好一陣子,因為 Amazon 限制一定要美國的 IP 才能購買
今天突然發現好像限制又取消了?
2012年5月8日 星期二
2012年2月12日 星期日
透過 dex2jar 和 JD-GUI 反編譯 APK
因為某種需求,想知道某些程式是如何撈到資料的...
透過 web scrawler 的方式遇到蠻多阻礙,所以就試試看從 APP 著手
意外發現這個相當邪惡的玩意兒~囧
2011年5月23日 星期一
Android 函式說明設定問題
參考網址:http://stackoverflow.com/questions/4980002/problems-with-javadoc
android 的 document 好像在安裝 SDK 時本來就包含在內了
只不過大概是我的 NB 安裝時曾經有安裝過 SDK 的安裝包,後來又改用 zip 的 SDK
所以 eclipse 指向的 document 位置是錯的。
2011年5月19日 星期四
嵌入自訂內容的 Dialog
簡單的作法可以參考 [Android] AlertDialog-嵌入客製化表單
在 AlertDialog 中加入 EditText,不過上面沒有取得 EditText 內容的方法
下面是我的 code:
2011年4月29日 星期五
2011年4月5日 星期二
在模擬器中查看 SQLiteDatabase 內容
有時候直接看資料庫內容還是比較方便,可以確認寫入的資料是否正確
在模擬器中是必須先進去 Android 的 Android Debug Bridge(即 adb)模式
才有辦法讀取資料庫的檔案並且直接對資料庫下 SQL statement 查看或更改資料庫內容。
圖文說明可以參考一個大陸的網頁:adb shell下查看sqlite數據庫
2011年2月18日 星期五
DatePicker 和 Button Click 的小範例
範例內容跟 Android Developer 官方的範例其實有點類似
不過我個人傾向的事件寫法是在別的地方寫好 function
然後在設定 onClick 之類的事件時再指定到我寫好的 function
官方範例用下面這種寫法我覺得會讓程式碼很亂....
pucliv onCreate() { ... mPickDate.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { showDialog(DATE_DIALOG_ID); } }); ... }
2011年2月14日 星期一
@+id/name 跟 @android:id/name 的差別
官方的文件 Declaring Layout 中有以下說明:
The at-symbol (@) at the beginning of the string indicates that the XML parser should parse and expand the rest of the ID string and identify it as an ID resource. The plus-symbol (+) means that this is a new resource name that must be created and added to our resources (in the R.java file). There are a number of other ID resources that are offered by the Android framework. When referencing an Android resource ID, you do not need the plus-symbol, but must add the android package namespace, like so:
android:id="@android:id/empty"
意即,@ 表示 XML parser 需要將接下來的字串轉換成 ID resource,其中 @+ 表示這是新的 resource name,必須新建到 R.java 內;@android:id 則表示指向的這個 resource name 是已經存在的 resource。
2011年1月5日 星期三
2011年1月3日 星期一
Android 入門的相關資源
gasolin 寫的 Android 入門教學
http://code.google.com/p/androidbmi/wiki/IntroAndroid
「Brad Free School 趙令文自由學校」,也是入門教學的網站
http://school.brad.tw/mod/resource/index.php?id=67
「Android學習筆記」,有一些比較基本的 Android 範例程式碼!
http://cooking-java.blogspot.com/search/label/Android
「A Visual Guide to Android GUI Widgets」,顯示 Android 上可用的一些 view 的長相,另外這個網站本身有提供 droiddraw 這個圖形化介面,可以幫助使用者快速產生 Android 需要的介面的 XML 檔。
http://www.droiddraw.org/widgetguide.html
「國立金門大學 九十六學年度資訊工程學系專題 Android教學範例」,有一些基本應用的範例,註解也寫得還蠻詳細的~
http://gogkmit.wikidot.com/start
「靈機一動:我的專案網」,有一些比較基本的 Android 程式教學
http://www.myproject.com.tw/node/19