欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于linux與windows平臺(tái)下 如何下載android sdk源代碼的方法詳解

 更新時(shí)間:2013年05月10日 11:55:39   作者:  
本文主要是介紹在linux和windows平臺(tái)下,如何下載android sdk的源代碼,注意是sdk的源代碼,而不是android的所有源代碼,同時(shí)介紹如何把sdk源代碼加入到eclipse里,使android 平臺(tái)手機(jī)開發(fā)者可以直接查看源代碼,通過閱讀SDK源碼,能更好的理解和運(yùn)用Android的API

本文主要分2部份。第1部份介紹如何下載android sdk的源代碼;第2部份介紹如何把a(bǔ)ndroid sdk的源代碼加入到eclipse里

第1部份如何下載android sdk的源代碼 

1、環(huán)境。 Linux 2.6 ,Python 2.4.3 或windows XP

2、工具。主要使用git工具,下載android sdk source。

(1)Linux下git工具可以到 http://git-scm.com/ 下載,此工具是linux的核心代碼管理工具。

安裝過程如下:

tar -xvf git-1.6.6.tar.bz2./configuremakemake install    

(2)在Windows下安裝則和其他應(yīng)用程序安裝是一樣的。

        Windows下Git下載地址:http://code.google.com/p/msysgit/downloads/list

        目前最新版本為:msysGit-fullinstall-1.7.1-preview20100612.exe   31.6 MB


3、下載android sdk的源代碼


Windows版本的Git提供有Linux shell命令行和GUI圖形界面兩種不同的操作方式,

用默認(rèn)安裝選項(xiàng)安裝時(shí),添加在桌面上的Git圖標(biāo)為啟動(dòng)使用shell命令工具,操作指令和用法則和Linux下一樣            


mkdir android_sdk_src  建立存放Android SDK源文件的目錄

cd android_sdk_src      進(jìn)入新建的目錄

git clone git://android.git.kernel.org/platform/frameworks/base.git  下載Android SDK源碼

              附上Android資源分布說明:
              http://source.android.com/projects#TOC-External-projects
              Android的Git資源:http://android.git.kernel.org/
              Git中文教程:http://www.bit(此處括號(hào)僅起分割作用,實(shí)際地址無括號(hào)以及此括號(hào)內(nèi)內(nèi)容)sun.com/documents/gittutorcn.htm
              Git下載地址:http://code.google.com/p/msysgit/

              在http://android.git.kernel.org/的主頁上講得很清楚,

              如果是想要獲得部分git資源(To clone one of these trees, install git, and run:),請(qǐng)使用

git clone git://android.git.kernel.org/ + project path.git

             附上下載整個(gè)Android的方法
             repo腳本可以到 http://android.git.kernel.org/repo 獲得。
             使用curl命令下載并部署此腳本
             curl http://android.git.kernel.org/repo >/bin/repo

 

$ curl http://android.git.kernel.org/repo >~/bin/repo$ chmod a+x ~/bin/repo$ mkdir mydroid$ cd mydroid$ repo init -u git://android.git.kernel.org/platform/manifest.git$ repo sync

      第2部份 如何把源碼附加到eclipse里。

      此部分的詳細(xì)配置方法請(qǐng)查看http://stuffthathappens.com/blog/2008/11/01/browsing-android-source-in-eclipse/
      在此對(duì)這篇文章引述如下:

       1、在你的SDK目錄下,即你的 android.jar 所在目錄下新建sources目錄,把下載的源代碼(我的源代碼的根目錄為base)里的base\core\java\下的文件夾android和com復(fù)制到
           放到sources下。具體的目錄結(jié)構(gòu)如下

SDK_PATH
  | android.jar
  +--docs/...
  +--samples/...
  +--sources
       +--android
       |      ...accounts, annotation, app, bluetooth, etc...
       +--com/android/etc...
       +--dalvik/...
       +--java/...
       +--javax/...

2、然后重新打開eclipse,就完成了源代碼的附加

相關(guān)文章

最新評(píng)論