1.
從官方網站上面http://developer.android.com/sdk/index.html下載打包好的android 開發環境包,自動解壓安裝。
安裝了ADT外掛程式和NDK外掛程式:
在Eclipse的工具列裡面找到help->install new software,
Add Repository 對話方塊中,Name隨便起個名字,然後Location輸入:
https://dl-ssl.google.com/android/eclipse/
選擇相應的開發組件,特別是NDK PLUGINS,以便將來利用C++、C的本地代碼進行開發。
2. 配置相關的環境變數。
ADB_ROOT:D:\develop\adt-bundle-windows-x86\sdk\platform-tools
NDK_ROOT: D:\develop\android-ndk-r8d
3.根據官網上的說明建立第一個應用程式。
建立 AVD, 然後運行編寫的Hello world 程式。
注意期間會出現1個錯誤:
.報錯:
The connection to adb is down, and a severe error has occured.
[2010-03-11 09:36:56 - HelloOPone] You must restart adb and Eclipse.
[2010-03-11 09:36:56 - HelloOPone] Please ensure that adb is correctly located at 'D:\develop\adt-bundle-windows-x86\sdk\platform-tools\adb.exe'
and can be executed.
從網上找了些解決方案,
(1)http://logger.iteye.com/blog/911977
(2)http://www.crifan.com/android_adt_the_connection_to_adb_is_down__and_a_severe_error_has_occured/
但是都沒有解決,根據看到的方法,估計是adb啟動並執行連接埠被某個程式佔用了,或者是avd start的順序不對。
我重新啟動了一下電腦,開啟Eclipse中的MyFirstApp 工程,選中 preference-> avd mananger, 啟動avd模擬器裝置,
再到CMD下面重新啟動 adb server.
adb start-server
看到啟動資訊在連接埠5037.
然後點擊 Run, 這個android程式終於正常運行。解決問題。