2013年1月7日 星期一

萬丈高樓平地起

安裝教學
http://sofun.tw/android-eclipse/


1.下載 Eclipse Classic
http://www.eclipse.org/downloads/


2.下載 Java SE 7u10 JDK
http://www.oracle.com/technetwork/java/javase/downloads/index.html


3.用eclipse下載android套件 之後 會自動下載android SDK套件
"Install New Software" 在Wordk with 視窗旁邊點選 "Add"按鈕
Name:Android
Location:https://dl-ssl.google.com/android/eclipse/


4.Android SDK Manager
除了Android1.6(API4) Android1.5(API3) 不要裝以外 其他都安裝


5.匯入各種專案 可以一口氣匯入(如果出現錯誤 就重開Eclipse 然後改個專案名稱(把多加的Activity刪除)


6.電腦連接手機 安裝手機驅動 瀏覽AndroidSDK \extras\google\usb_driver\
http://developer.android.com/tools/extras/oem-usb.html#InstallingDriver

galaxy nexus driver 要去官網抓
http://www.samsung.com/us/support/owners/product/SCH-I515MSAVZW


7.下載SVN 要認明有烏龜的
http://tortoisesvn.net/downloads.html

2012年3月18日 星期日


你去eclipse安裝目錄找eclipse.ini文件可調整Eclipse最大使用記憶體,

eclipse.ini文件預設如下:
-vmargs
-Xms40m
-Xmx256m

1G推薦:
-vmargs
-Xms128M
-Xmx512M
-XX:PermSize=64M
-XX:MaxPermSize=128M
2G推薦:
-vmargs
-Xms128M
-Xmx768M
-XX:PermSize=64M
-XX:MaxPermSize=512M

2012年3月4日 星期日

Eclipse執行錯誤 = Installation failed due to invalid APK file!


[2012-03-05 11:01:44 - arrowKnee] Installation failed due to invalid APK file!
[2012-03-05 11:01:44 - arrowKnee] Please check logcat output for more details.
[2012-03-05 11:01:44 - arrowKnee] Launch canceled!



[2012-03-05 11:15:53 - arrowKnee] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
[2012-03-05 11:15:53 - arrowKnee] Please check logcat output for more details.
[2012-03-05 11:15:53 - arrowKnee] Launch canceled!



遇到以上錯誤的解決方法為


以上第三點為最主要 並且還要將程式先從手機上移除

2012年2月29日 星期三

eclipse開發注意事項


前置教學
https://sites.google.com/site/cgm1004release1/intro

http://renren.it/a/bianchengyuyan/ASP/20110310/79384.html

http://blog.chinatimes.com/tomsun/archive/2010/09/07/536320.html

http://www.oracle.com/technetwork/java/javase/downloads/index.html

http://www.eclipse.org/downloads/

http://www.andengine.org/forums/tutorials/getting-started-with-andengine-t11.html

andEngine修改好可用版本
https://sites.google.com/site/adkteccom/Home/AndEngine.7z?attredirects=0&d=1

YoLib
https://sites.google.com/site/adkteccom/Home/YoDawnLaLib.7z?attredirects=0&d=1

專案property設定

模擬器設定畫面(如果要有聲音的話 啟動時 把snapshot關掉)




2012年1月2日 星期一

Vs2008執行時出現“No Debugging Information”錯誤的解決方法

當我們運行程式 如果跳出這段話
Debugging information for ‘xxx.exe’ cannot be found or does not match.Symbols not loaded

解決方法:
1.選單Project->property->Linker->Debugging, "Generate Debug Info" 拉下選單選擇"Yes(/DEBUG)".OK。

2.如果第一個方法無效就先把程式關掉,之後去目錄下把XXX.suo檔給砍掉,再啟動即可。




如果之後斷點變成三角形驚嘆號 無法DEBUG的話

Tools->Options->Debugging->General ->  "Require source to exactly match..." 將打勾取消

2011年12月6日 星期二

各種轉換


//硬轉
static_cast<Chest *>(obj)

//分割文字
Ogre::StringUtil::split(name, ",").at(0);

//字串轉數字--atoi--
String name1 = "1";
String name2 = "2";
String name3 = "THIS" + name1 + "3" + name2;
int id = atoi(name3.c_str());//String To Int
printf("利用atoi把字串轉成數字 = %d \n", id);

//數字轉字串--itoa--
int number = 12345;
char str[10];
itoa(number, str, 10);//10代表十進制
printf("利用itoa把數字轉換成字串 = %s \n", str);

//數字轉字串--sprintf_s--
number = 54321;
sprintf_s(str, sizeof(str), "%d", number);
String final = "TEST";
final = final + str;
printf("利用sprintf_s把數字轉換成字串 = %s ", final.c_str());

//內建數字轉字串
final = StringConverter::toString(number);
printf("利用內建數字轉字串 = %s ", final.c_str());

//Shlwapi.lib PROJECT要有這個才可以用 #include "Shlwapi.h"
int no1 = StrToInt(L"123456789");
printf("%d \n", no1);

//char轉string == String(char)

//string轉char == str.c_str()
sprintf_s(account, 20, "%s", accountStr.c_str());

2011年11月24日 星期四

QT用法

一個好用又強大的 視窗編輯工具(比VS2008內建的強大)

QT工具設定
http://magichnology.wordpress.com/2011/06/02/qt-setting/

QT教學
http://program-lover.blogspot.com/2008/09/qt-tutorial.html


#include "server.h"
#include <boost/thread/thread.hpp>
#include "ThreadClass.h"
#include <QtGui/QApplication>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

//使中文不會變亂碼
QTextCodec::setCodecForCStrings(QTextCodec::codecForName(QTextCodec::codecForLocale()->name()));
QTextCodec::setCodecForLocale(QTextCodec::codecForName(QTextCodec::codecForLocale()->name()));
QTextCodec::setCodecForTr(QTextCodec::codecForName(QTextCodec::codecForLocale()->name()));

Server* server= new Server();
server->show();

return app.exec();
}