分析android studio的项目结构

以最简单的工程为例子,工程名为随意乱打的Exp5,新建好工程后将项目结构模式换成android:

1.manifests

   AndroidManifest.xml:APP的配置信息

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 3     package="com.example.administrator.exp5">
 4 
 5     <application
 6         android:allowBackup="true"
 7         android:icon="@mipmap/ic_launcher"
 8         android:label="@string/app_name"
 9         android:roundIcon="@mipmap/ic_launcher_round"
10         android:supportsRtl="true"
11         android:theme="@style/AppTheme">
12         <activity android:name=".MainActivity">
13             <intent-filter>
14                 <action android:name="android.intent.action.MAIN" />
15                 <category android:name="android.intent.category.LAUNCHER" />
16             </intent-filter>
17         </activity>
18     </application>
19 </manifest>

其中android:allowBackup 是否允许应用程序备份和恢复,

  android:icon 用于指定项目的应用图标,

  android:label 应用程序的名称,

  android:supportsRtly 应用支持从右到左(原来RTL就是right-to-left 的缩写...)的布局,

  android:theme 应用程序的主题,

  <activity android:name=".MainActivity">....</activity> 对MainActivity这个活动进行注册,没有注册的活动不能使用,

  <action android:name="android.intent.action.MAIN" />表示该活动是项目的主活动

  <category android:name="android.intent.category.LAUNCHER" />表示该活动是项目首先启动的活动

2.java

  我们放置所有java代码的地方

3.res

  在项目中使用到的所有资源文件都要存放在该目录下

  图片放在drawable目录下,布局放在layput目录下,字符串放在values下,mipmap文件都是用来放应用图标的

  

 

posted @ 2017-08-09 16:41  xxbbtt  阅读(367)  评论(0编辑  收藏  举报