简单认识APP项目

manifests:里面只有一个xml,是app运行配置文件 清单文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | <?xml version= "1.0" encoding= "utf-8" ?> <manifest xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" > <application //是否允许备份 android:allowBackup= "true" android:dataExtractionRules= "@xml/data_extraction_rules" android:fullBackupContent= "@xml/backup_rules" //指定图标 android:icon= "@mipmap/ic_launcher" //指定名称 android:label= "@string/app_name" //圆角图标 android:roundIcon= "@mipmap/ic_launcher_round" //是否支持从右向左的文字排列顺序 android:supportsRtl= "true" //主要主题风格 android:theme= "@style/Theme.MyApplication" tools:targetApi= "31" > <activity android:name= ".MainActivity" android:exported= "true" > <intent-filter> <action android:name= "android.intent.action.MAIN" /> <category android:name= "android.intent.category.LAUNCHER" /> </intent-filter> <meta-data android:name= "android.app.lib_name" android:value= "" /> </activity> </application> </manifest> |
java:三个包 第一个包存放当前模块源代码,后面两个包存放测试用java代码
res:存放资源(还有一个xml没提)
全局配置(全局生效)与模块配置(仅当前app声效)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | plugins { id 'com.android.application' } android { namespace 'com.example.myapplication' //指定编译的用的SDK版本号 30表示android11.0 compileSdk 32 defaultConfig { //此处为应用的包名/模块名 **注意与清单文件内的包名一致 applicationId "com.example.myapplication" //最小可运行的版本号 minSdk 21 //表示出你最希望的运行版本号 targetSdk 32 //APP的应用版本号 versionCode 1 //APP的应用版本名称 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile( 'proguard-android-optimize.txt' ), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } //指出APP依赖信息 dependencies { implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)