Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> Android工程的目錄結構詳解

Android工程的目錄結構詳解

編輯:關於Android編程

在搭建Android開發環境及簡單地建立一個HelloWorld項目後,本篇將通過HelloWorld項目來介紹Android項目的目錄結構。本文的主要主題如下:

1、HelloWorld項目的目錄結構

· 1.1、src文件夾

· 1.2、gen文件夾

· 1.3、Android 2.1文件夾

· 1.4、assets

· 1.5、res文件夾

· 1.6、AndroidManifest.xml

· 1.7、default.properties

\

下面將分節介紹上面的各級目錄結構。

1.1、src文件夾

顧名思義(src, source code)該文件夾是放項目的源代碼的。打開HelloWZ喎?/kf/ware/vc/" target="_blank" class="keylink">vcmxkLmphdmHOxLz+u+G/tLW9yOfPwrT6wuujujwvcD4KPHA+v8nS1NaqtcCjus7Sw8fQwr2o0ru49rzytaW1xEhlbGxvV29ybGTP7sS/o6zPtc2zzqrO0sPHyfqzycHL0ru49khlbGxvV29ybGQuamF2Yc7EILz+oaPL+7W8yOvBy8G9uPbA4GFuZHJvaWQuYXBwLkFjdGl2aXR5us1hbmRyb2lkLm9zLkJ1bmRsZaOsSGVsbG9Xb3JsZMDgvMyz0NfUQWN0aXZpdHnH0tbYINC0wctvbkNyZWF0Zbe9t6ihozwvcD4KPHA+0tTPwsu1w/fV67bUw7vT0NGnuf1KYXZhu/LV30phdmG7+bShsaHI9bXEyMsgQE92ZXJyaWRlINTa1tjQtLi4wOC1xG9uQ3JlYXRlyrGjrNTat723qMeww+a808nPQE92ZXJyaWRlIM+1zbO/ydLUsO/E47zssum3vbeotcTV/ci30NSho8D9yOejrHB1YmxpYyB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpe6Gtoa0ufdXi1tbQtLeoysfV/ci3tcSjrMjnufvE49C0s8lwdWJsaWMgdm9pZCBvbmNyZWF0ZShCdW5kbGUgc2F2ZWRJbnN0YW5jZVN0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3A+CjxwPtXiwO/BvdDQtPrC677Nyse002FuZHJvaWQuamFytbzI67D8oaM8L3A+CjxwPjEuNKGiYXNzZXRzPC9wPgo8cD6w/Lqs06bTw8+1zbPQ6NKqyrnTw7W9tcTW7sjnbXAzoaLK08a1wOC1xM7EvP6hozwvcD4KPHA+MS41oaJyZXPOxLz+vNA8L3A+CjxwPtfK1LTEv8K8o6yw/LqsxOPP7sS/1tC1xNfK1LTOxLz+sqK9q7Hg0uu9+NOm08OzzNDyoaPP8rTLxL/CvMztvNPXytS0yrGjrLvhsbtSLmphdmHX1LavvMfCvKGj0MK9qNK7uPbP7sS/o6xyZXPEv8K8z8K74dPQyP249tfTxL/CvKO6ZHJhd2FiZWyhomxheW91dKGidmFsdWVzoaM8L3A+CjxwPqGkIGRyYXdhYmVsLT9kcGmjurD8uqzSu9CpxOO1xNOm08OzzNDyv8nS1NPDtcTNvLHqzsS8/igqLnBuZ6GiKi5qcGcpPC9wPgo8cD6hpCBsYXlvdXSjur3nw+ayvL7WzsS8/ihtYWluLnhtbCnT61dFQtOm08PW0LXESFRNTMDgzayjrMO70N64xLn9tcRtYWluLnhtbM7EvP7I58/Co6hIZWxsb1dvcmxktcS+zcO709DQ3rjEuf2jqaO6PC9wPgo8cD48aW1nIHNyYz0="/uploadfile/Collfiles/20150105/20150105085158176.png" alt="\">

· values:軟件上所需要顯示的各種文字。可以存放多個*.xml文件,還可以存放不同類型的數據。比如arrays.xml、colors.xml、dimens.xml、styles.xml

· 1.6、AndroidManifest.xml

項目的總配置文件,記錄應用中所使用的各種組件。這個文件列出了應用程序所提供的功能,在這個文件中,你可以指定應用程序使用到的服務(如電話服務、互聯網 服務、短信服務、GPS服務等等)。另外當你新添加一個Activity的時候,也需要在這個文件中進行相應配置,只有配置好後,才能調用此 Activity。AndroidManifest.xml將包含如下設置:application permissions、Activities、intent filters等。

HelloWorld項目的AndroidManifest.xml如下所示:

\

關於AndroidManifest.xml現在就講這麼多,此系列後面的文章將單獨詳細介紹。

1.7、 default.properties

記錄項目中所需要的環境信息,比如Android的版本等。

HelloWorld的default.properties文件代碼如下所示,代碼中的注釋已經把default.properties解釋得很清楚了:

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved