linux下android開發環境的配置

來源:互聯網
上載者:User

下文不全,請轉此處:http://www.cnblogs.com/macobolo/archive/2009/03/17/1414238.html

 

1.下載android sdk
如下:
http://dl.google.com/android/android-sdk-windows-1.5_r2.zip
 

http://dl.google.com/android/android-sdk-linux_x86-1.5_r2.zip
 

2. 下載eclipse 3.4.2
 按官方文檔說,android sdk 可以運行在eclipse 3.3以上的IDE中,ubuntu源中的eclipse版本過低,建議使用eclipse 3.4.2,其為: 
http://download.actuatechina.com/eclipse/eclipse/downloads/drops/R-3.4.2-200902111700/eclipse-SDK-3.4.2-linux-gtk.tar.gz
 

3. 安裝eclipse 3.4.2
先將eclipse解壓:
$tar xzvf eclipse-SDK-3.4.2-linux-gtk.tar.gz
 
 將解壓出的eclipse檔案夾移動到目標目錄中去,在 這裡我設定的安裝目標為:/usr/local下。
$sudo mv eclipse /usr/local/

(
 Java libjvm.so and SELinux error:

/opt/jre1.6.0_03/bin/../lib/i386/client/libjvm.so: cannot restore segment prot after reloc: Permission denied

解決方案:chcon -t textrel_shlib_t /opt/jre1.6.0_03/lib/i386/client/libjvm.so

)

4.安裝android sdk
解壓android sdk包:
$unzip android-sdk-linux_x86-1.5_r2.zip

移動到目標目 錄:<在這裡我將解壓出的sdk檔案夾目錄改成了android-sdk>
$mv android-sdk-linux_x86-1.5_r2 android-sdk
$sudo mv android-sdk /usr/local/

5.配置環境變數:
修改~/.bashrc檔案,加入android sdk與eclipse的環境變數。
$vi ~/.bashrc

在檔案的最 後加入
export PATH=/usr/local/android-sdk/tools:/usr/local/eclipse:$PATH

儲存並 退出vi
使配置資訊生效
$source ~/.bashrc

6.android avd配置資訊的產生
android avd的建立格式為:android create avd -n your-avd-name -t your-targets
其中:-n的參數為我們要建立的avd的名字;-t的參數為Available Android targets的id,我們可以使用命令:android list查尋其具體資訊。
$android list

Available Android targets:
id: 1
     Name: Android 1.1
     Type: Platform
     API level: 2
     Skins: HVGA-P, HVGA (default), QVGA-P, HVGA-L, QVGA-L
id: 2
     Name: Android 1.5
     Type: Platform
     API level: 3
     Skins: HVGA-P, HVGA (default), QVGA-P, HVGA-L, QVGA-L
id: 3
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Description: Android + Google APIs
     Based on Android 1.5 (API level 3)
     Libraries:
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: QVGA-P, HVGA-L, HVGA (default), QVGA-L, HVGA-P
Available Android Virtual Devices:
 

下面我們就以建立一個android 1.5的avd為例:

$android create avd -n android-sdk-15 -t 2

Android 1.5 is a basic Android platform.
Do you wish to create a custom hardware profile [no]yes

Device ram size: The amount of physical RAM on the device, in megabytes.
hw.ramSize [96]:128

Touch-screen support: Whether there is a touch screen or not on the device.
hw.touchScreen [yes]:yes

Track-ball support: Whether there is a trackball on the device.
hw.trackBall [yes]:yes

Keyboard support: Whether the device has a QWERTY keyboard.
hw.keyboard [yes]:yes

DPad support: Whether the device has DPad keys
hw.dPad [yes]:yes

GSM modem support: Whether there is a GSM modem in the device.
hw.gsmModem [yes]:yes

Camera support: Whether the device has a camera.
hw.camera [no]:

Camera support: Whether the device has a camera.
hw.camera [no]:yes

Maximum horizontal camera pixels
hw.camera.maxHorizontalPixels [640]:854

Maximum vertical camera pixels
hw.camera.maxVerticalPixels [480]:480

GPS support: Whether there is a GPS in the device.
hw.gps [yes]:yes

Battery support: Whether the device can run on a battery.
hw.battery [yes]:yes

Accelerometer: Whether there is an accelerometer in the device.
hw.accelerometer [yes]:yes

Audio recording support: Whether the device can record audio
hw.audioInput [yes]:yes

Audio playback support: Whether the device can play audio
hw.audioOutput [yes]:yes

SD Card support: Whether the device supports insertion/removal of virtual SD Cards.
hw.sdCard [yes]:yes

Cache partition support: Whether we use a /cache partition on the device.
disk.cachePartition [yes]:yes

Cache partition size
disk.cachePartition.size [66MB]:100MB

Created AVD ''android-sdk-15'' based on Android 1.5

這樣我們就建立了一個基於1.5的avd,上面的具體意思我想大家都能看懂,就不多說了。下在我們就可以測試一下android emulator了:

$emulator @android-sdk-15 -show-kernel

這樣就可以啟動android emulator了:


 

加入參數-show-kernel是為了在終端上列印android kernel的資訊。

下面我們配置eclipse,使之支援android sdk:

開啟Eclipse,Help->Software Updates->Available Software,點擊
Add site,輸入
http://dl-ssl.google.com/android/eclipse/

然後安裝。完成後就可以開始在eclipse上建立android應用程式了。

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

轉載: 在 Fedora 下安裝 Android SDK 開發環境Android是Google推出的基於Linux的開源智能手機平台,本文講述如何在Fedora系統下架設Android開發環境。 

全部流程以 Fedora 11 X86 版本為例。 

1.下載Android SDK
 

首先,前往從以下網站擷取 Android Linux 平台的 SDK 套件,目前只有 i386 架構的。 

http://developer.android.com/sdk/ 

撰寫本文時最新版本為 1.5 Release 2,下載完成會得到一個 zip 格式的壓縮檔案。 

2. 解壓縮並配置相關環境變數
 

將獲得的 zip 解壓到所喜好的位置即可,無須安裝。 

接下來需要將 SDK 目錄中的 tools 添加到 PATH 路徑中,方便調用。編輯 $HOME/.bash_profile 檔案,在 PATH 一行末尾添加 SDK 中 tools 檔案路徑即可,用冒號分割。 

推薦為其 Android SDK 目錄建立一個不包括版本號碼的符號連結,這樣日後 SDK 升級時就無須調整 PATH 路徑了。 

3. 安裝 Eclipse 整合式開發環境
 

Android 推薦的 IDE 為 Eclipse,使用下面的命令安裝它: 

.su -c 'yum install eclipse-jdt java-1.6.0-openjdk-devel' 

即可獲得 Fedora Eclipse 3.4.2 版本。 

4.配置 Android Development Tools
 

首先要添加 Eclipse 的官方升級倉庫,滿足 Android Development Tools 所需要的 eclipse-wdt 。 

在 Eclipse -> Help -> Software Updates -> Available Software -> Manage Sites 中勾選 Ganymede Update Site,點擊 Close 返回 Available Software。 

在 Available Software 點擊 Add sites,輸入 

https://dl-ssl.google.com/android/eclipse/ 

然後勾選新出現的 Android DDMS 和 Android Development Tools 即可。 

此刻 Android SDK 配置完成,可以開始 Android 平台應用軟體的開發啦!

+++++++++++++++++++++++++++++++++++++++
 


相關連結:配置您的Android開發環境Windows系統部署 Android 開發環境以及驗證之傻瓜式教程(SDK+Eclipse+ADT)Android 簡單例子以及入門學習資料連結Android模擬器和安裝APK檔案基礎教程Linux下安裝配置Android開發環境解決方案:Eclipse的 window-->preferences裡面沒有Android選項linux下安裝Android開發環境

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.