2011年6月28日 星期二

Android Starter

一、下載 JAVA SE JDK,安裝


二、下載 Android SDK,安裝






三、下載 Eclipse Classic,安裝


四、執行 Eclipse,按下列步驟安裝 ADT  Plug-in (摘自 http://developer.android.com/sdk/eclipse-adt.html#installing)

  1. Start Eclipse, then select Help > Install New Software....
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:
    https://dl-ssl.google.com/android/eclipse/
  4. Click OK Note: If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).
  5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  6. In the next window, you'll see a list of the tools to be downloaded. Click Next.
  7. Read and accept the license agreements, then click Finish. Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
  8. When the installation completes, restart Eclipse. 這邊會開始下載安裝比較久的時間。

五、 執行 Eclipse,到選單 > Windows > Android SDK and ADV Manager 開啟 ADV Manager (或透過直接執行 ADV Manager 亦可)。
此時若出現找不到 ADV Manager 位置的話,則要到選單 > Windows > Preferences > Andriod 頁面進行設定。




六、第一次執行 ADV Manager 要先安裝相關套件,這邊也是會開始下載安裝一段時間




七、新增加一個 ADV (Android模擬器),名稱自己取



八、OK 後就可以在 ECLIPSE 開 Android 專案了,Build Target 記得選剛剛建立好的 ADV 版本。





九、寫個範例程式…(摘自 http://developer.android.com/resources/tutorials/hello-world.html)

package example.HelloAndroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroidActivity extends Activity {
       /** Called when the activity is first created. */
       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           TextView tv = new TextView(this);
           tv.setText("Hello, Android");
           setContentView(tv);
       }
}

十、執行結果…

沒有留言:

更高效處理 micro second 的方式

更高效處理 micro second 的方式…  以 STM32 為例… __IO unsigned long sys_tick = 0; void SysTick_Handler(void) {     HAL_IncTick();     sys_tick += (SysTi...