2011年1月4日 星期二

將android ap 放到實際android機器上 via eclipse

build error

Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project RTKGPSDemoApp Unknown Java Problem
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files GPSDemo.java /RTKGPSDemoApp/src/rtk/gpsdemo/app line 1 Java Problem
Unable to resolve target 'android-8' until the SDK is loaded. RTKGPSDemoApp Unknown Android Target Problem

--
設定環境
執行Eclipse
Window->Preference->Android->SDK Location: /nelsonchung/Develop/android-sdk-linux_86/
Apply

出現兩個Targe name
Android 2.2
Android 2.3

選擇其中一個
按下OK鍵

build ok
--

參考
產生新的AVD

設定完之後就可以跑在emulator上面嚕

--

如果不想run在emulator
而是run在實際機器上
請follow下列步驟
1. 開啟機器, 插上usb cable, eclipse會自動偵測



2. 執行下方圖片run icon (滑鼠指標旁)


3. 點選Run Configuration

4. 點選target

5. 點選Manual


6. 按下run後 選擇你要執行的機器


--

改變系統預設java的路徑

目前java的設定為openjdk
nelsonchung@ubuntu:/etc/alternatives$ ll java
lrwxrwxrwx 1 root root 40 2010-12-08 09:09 java -> /usr/lib/jvm/java-6-openjdk/jre/bin/java*

我有兩個java - openjdk and java-6-sun
nelsonchung@ubuntu:/etc/alternatives$ ls /usr/lib/jvm
java-1.6.0-openjdk  java-6-openjdk  java-6-sun  java-6-sun-1.6.0.22

修改java path
sudo update-alternatives --config java

nelsonchung@ubuntu:/etc/alternatives$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      優先級  Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-6-sun/jre/bin/java to provide /usr/bin/java (java) in manual mode.
nelsonchung@ubuntu:/etc/alternatives$ ll java
lrwxrwxrwx 1 root root 36 2011-01-04 17:43 java -> /usr/lib/jvm/java-6-sun/jre/bin/java*

改變嚕

nelsonchung@ubuntu:/etc/alternatives$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Server VM (build 17.1-b03, mixed mode)


透過Facebook分享

沒有留言: