2010年6月22日 星期二

Error in an XML file: aborting build

寫一個android程式
卻出現這個error - Error in an XML file: aborting build

這時候執行
Project->Clean

再執行Run>Run

可以看下方的Console對話框的message

[2010-06-21 23:56:18 - ReadImage] Uploading ReadImage.apk onto device 'emulator-5554'
[2010-06-21 23:56:26 - ReadImage] Installing ReadImage.apk...
[2010-06-21 23:56:36 - ReadImage] Success!
[2010-06-21 23:56:36 - ReadImage] Starting activity com.nelsonchung.ReadImage.ReadImage on device
[2010-06-21 23:56:39 - ReadImage] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.nelsonchung.ReadImage/.ReadImage }
就代表已經將沒問題的android程式傳到模擬器嚕


執行結果

透過Facebook分享

2010年6月15日 星期二

The Quietly Brilliant Story of HTC



看到這段影片
感觸很多

要做好的產品
絕非一觸可及

國父革命也是要十一次才成功
htc手機要做到大家喜歡
也是努力了十幾年

它似乎告訴我
要有信心的堅持下去

透過Facebook分享

2010年6月14日 星期一

Android HelloWorld 跑不起來(based on Android 2.0)

先照
http://www.jollen.org/blog/2008/12/jollen-android-programming-2.html
以及android 官方網頁教學
http://developer.android.com/intl/zh-TW/resources/tutorials/hello-world.html
撰寫sample code

就是在onCreate
加上
TextView tv = new TextView(this);
tv.setText("Hello World - Nelson");
setContentView(tv);


然後點Run->Run->Android Application
等待emulator起來


卻只有看到主畫面 沒有看到Hello World


最後
你要把解鎖動作打開

就可以看到嚕


感謝Tommy跟Robert教學

下載到emulator的程式
可以在這邊找到
點首頁按鈕

點下方按鈕

看到紅色部份

透過Facebook分享

Eason剃頭嚕


透過Facebook分享

2010年6月10日 星期四

使用MFC:重複執行出現多個相同程式(Fixed)

目的:
重複執行相同程式只允許一個程式被執行.

問題點:
被重複執行出現多個相同程式.

解法:
使用mutex來解決.

SampleCode:
bool CInitRegStatusDlg::CheckLaunchTwiceTime(void)
{
bool bFound = false;
HANDLE hMutexOneInstantance=CreateMutex(NULL,TRUE,_T("InitRegStatusInstance"));
if(GetLastError() == ERROR_ALREADY_EXISTS)
{
bFound=true;
}
if(hMutexOneInstantance)
{
ReleaseMutex(hMutexOneInstantance);
}
return bFound;
}



透過Facebook分享