部落客廣告聯播
2011年8月5日 星期五
EasyMock + JUnit4 做單元測試
詳請參見良葛格的JUnit學習筆記:
http://caterpillar.onlyfun.net/Gossip/JUnit/EasyMock.html
更詳細的使用說明可參考官網:
http://easymock.org/EasyMock3_0_Documentation.html
2011年7月31日 星期日
Android: 如何在TabActivity裡面開啟Activity?
在設計Android程式時,我們使用了(繼承)TabActivity,以實現有分頁的畫面。
今天我們在分頁裡面有一個ListView列表元件,我們希望點選了某個ListItem時會出現另個Activity畫面(並且是在該Tab中),接著我們按下手機上的返回按鈕時,畫面又會回到剛剛的ListView列表的畫面,這該如何時做呢?
這裡有一個很詳盡的範例可參考:
How you can open Activities in tabActivity(Nested activities)
2011年7月12日 星期二
2011年7月11日 星期一
2011年6月10日 星期五
使用Eclipse配合AXIS2來建立WebService (Service及Client)
用Eclipse來建立WebService真的是很方便又簡單,下列這篇文章介紹了如何使用Eclipse配合AXIS2來建立WebService (Service及Client):
http://hans0713.blogspot.com/2008/07/eclipsewebservice.html
建立完WebService後,若需要整合AXIS2與Spring Framework,可參考官方文件:
http://axis.apache.org/axis2/java/core/docs/spring.html
http://hans0713.blogspot.com/2008/07/eclipsewebservice.html
建立完WebService後,若需要整合AXIS2與Spring Framework,可參考官方文件:
http://axis.apache.org/axis2/java/core/docs/spring.html
2011年5月19日 星期四
Struts2 中設定indexed properties內容(JSP 到 Action屬性)
<s:textfield name="person[%{#status.index}].name"></s:textfield>
詳見:
http://stackoverflow.com/questions/2032746/struts-2-problem-setting-back-indexed-properties-from-jsp-to-
action-class
詳見:
http://stackoverflow.com/questions/2032746/struts-2-problem-setting-back-indexed-properties-from-jsp-to-
action-class
2011年5月17日 星期二
Struts 2 tags OGNL裡的單字元字串
Struts2 的OGNL真的是滿難用的東西,
但是用了Struts2的tag就不得不碰,
在使用OGNL時若需比較單一字元內容的字串時,
請參考:
http://struts.apache.org/2.x/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html
但是用了Struts2的tag就不得不碰,
在使用OGNL時若需比較單一字元內容的字串時,
請參考:
http://struts.apache.org/2.x/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html
2011年4月25日 星期一
jQuery Mobile的history Stack與Login
故事是這樣的,在使用jQueryMobile時進入第一頁點連結進入其他頁時,
畫面上的Header左上角就會跑出'Back'回上頁的按鈕,這算是貼心的設計。
但是我現在在進入第一頁前多了一個Login頁面,
login成功後便會導向第一頁,但在此時進入第一頁,我不希望左上角有'back'按鈕
讓使用者按下後又跑回登入頁。這我該如何解決呢?
很簡單的我只要在登入頁的
畫面上的Header左上角就會跑出'Back'回上頁的按鈕,這算是貼心的設計。
但是我現在在進入第一頁前多了一個Login頁面,
login成功後便會導向第一頁,但在此時進入第一頁,我不希望左上角有'back'按鈕
讓使用者按下後又跑回登入頁。這我該如何解決呢?
很簡單的我只要在登入頁的
2011年4月20日 星期三
2011年4月19日 星期二
2011年4月13日 星期三
2011年3月3日 星期四
2011年2月25日 星期五
Google App Engine上使用Commons Upload實做檔案上傳
Google App Engine上使用Commons Upload實做檔案上傳
請參考:
http://shogi-software.blogspot.com/2009/04/google-app-engine-and-file-upload.html
2011年2月24日 星期四
GAE與Google Map Geocoding API 每日2500限制
2011年2月22日 星期二
JSON與JAVA物件的轉換- GSON
GSON是一套專司JSON與JAVA物件的轉換的Java library,
關於JSON的簡介:
http://myjavanote.blogspot.com/2010/06/json.html
關於GSON的使用請參考:
http://nadacode.com/2010/06/30/using-json-in-your-google-app-engine-java-app/
http://sites.google.com/site/gson/gson-user-guide
http://code.google.com/p/google-gson/
關於JSON的簡介:
http://myjavanote.blogspot.com/2010/06/json.html
關於GSON的使用請參考:
http://nadacode.com/2010/06/30/using-json-in-your-google-app-engine-java-app/
http://sites.google.com/site/gson/gson-user-guide
http://code.google.com/p/google-gson/
2011年2月21日 星期一
2011年2月20日 星期日
台彩最新獎號小工具 發佈 (免費)
終於這幾天將Desire HD入手了,
稍作實機測試後,把之前花了點時間寫的『台彩最新獎號小工具』發布到Android Market上了。
『台彩最新獎號小工具』以小工具(Widget)形式讓您可擺放桌面上,隨時得知最新獎號,另也可查詢顯示上期、上上期之獎號。另按下開獎獎號文字可顯示該期更詳細資訊。
詳細介紹頁面如下:
https://sites.google.com/site/dolphsworkshopdolphgongfang/gong-fang-ruan-ti-ji/android-ruan-ti/tai-cai-zui-xin-jiang-haowidget
或直接前往Market頁面下載︰
https://market.android.com/details?id=idv.dolph.lottoappwidget
稍作實機測試後,把之前花了點時間寫的『台彩最新獎號小工具』發布到Android Market上了。
『台彩最新獎號小工具』以小工具(Widget)形式讓您可擺放桌面上,隨時得知最新獎號,另也可查詢顯示上期、上上期之獎號。另按下開獎獎號文字可顯示該期更詳細資訊。
詳細介紹頁面如下:
https://sites.google.com/site/dolphsworkshopdolphgongfang/gong-fang-ruan-ti-ji/android-ruan-ti/tai-cai-zui-xin-jiang-haowidget
或直接前往Market頁面下載︰
https://market.android.com/details?id=idv.dolph.lottoappwidget
2011年2月15日 星期二
Android PendingIntent中放置Extra值問題
.....(略)
Intent it= new Intent(this , MyActivity.class);
it.putExtra("myFlag", dynamicFlag);
PendingIntent pit= PendingIntent.getActivity(this, 0, it, 0);
remoteViews.setOnClickPendingIntent(R.id.btnMyButton, pit);
....(略)
上列是我在寫AppWidget時的程式片段,這段程式主要是要在App Widget上的按鈕按下時,開啟某Actitity(並傳遞myFlag extra值給該Activity)以顯示所需資訊,但當我在MyActivity取得myFlag值時卻一直都是0,百思不解,後來修改程式,將PendingIntent.getActitity的最後個參數換成:
PendingIntent pit= PendingIntent.getActivity(this, 0, it, PendingIntent.FLAG_UPDATE_CURRENT);後竟然就正常了~
關於該參數該使用那個FLAG請參考:
http://developer.android.com/reference/android/app/PendingIntent.html#getActivity(android.content.Context, int, android.content.Intent, int)
http://stackoverflow.com/questions/4472447/confusing-behavior-when-starting-new-activity-with-pendingintent/5013713#5013713
Intent it= new Intent(this , MyActivity.class);
it.putExtra("myFlag", dynamicFlag);
PendingIntent pit= PendingIntent.getActivity(this, 0, it, 0);
remoteViews.setOnClickPendingIntent(R.id.btnMyButton, pit);
....(略)
上列是我在寫AppWidget時的程式片段,這段程式主要是要在App Widget上的按鈕按下時,開啟某Actitity(並傳遞myFlag extra值給該Activity)以顯示所需資訊,但當我在MyActivity取得myFlag值時卻一直都是0,百思不解,後來修改程式,將PendingIntent.getActitity的最後個參數換成:
PendingIntent pit= PendingIntent.getActivity(this, 0, it, PendingIntent.FLAG_UPDATE_CURRENT);後竟然就正常了~
關於該參數該使用那個FLAG請參考:
http://developer.android.com/reference/android/app/PendingIntent.html#getActivity(android.content.Context, int, android.content.Intent, int)
http://stackoverflow.com/questions/4472447/confusing-behavior-when-starting-new-activity-with-pendingintent/5013713#5013713
2011年2月11日 星期五
Eclipse 3.6.1的儲存動作(Save Actions)功能
所謂的 儲存動作(Save Actions)功能 ,就是在儲存檔案的時候自動的作些附加的處理,
詳見:
http://java.dzone.com/tips/eclipse-save-actions?
utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+javalobby/frontpage+(Javalobby+/+Java+Zone)
2011年2月10日 星期四
關於 動態Android App Widget大小 的討論 與 一個範例
關於 動態Android App Widget大小 的討論:
http://groups.google.com/group/
android-developers/browse_thread/
thread/17d79c52a1e4f83d?pli=1
App Widget範例 Android-SKY天氣預報widget:
http://code.google.com/p/android-sky/
http://jsharkey.org/blog/2009/04/24/forecast-widget-for-android-15-with-source/
訂閱:
文章 (Atom)