<application //允许数据被备份/恢复 androID:allowBackup="true" //普通图标 androID:icon="@mipmap/ic_launcher" //名称 androID:label="@string/app_name" //圆形图标 androID:roundIcon="@mipmap/ic_launcher_round" //是否支持从左到右布局 androID:supportsRtl="true" //主题 androID:theme="@style/Apptheme"> //注册活动 <activity androID:name=".MainActivity"> //过滤器 <intent-filter> //指定该活动为主活动 <action androID:name="androID.intent.action.MAIN" /> //显示桌面图标 <category androID:name="androID.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
java目录com.example.xxxxxxx.java:活动文件
res目录drawable:存放图片layout:存放布局文件mipmap:存放图标values:存放字符串、样式、颜色strings.xml:存放字符串
java代码调用:R.string.nameXML调用:@string/nameGradle Scriptsbuild.gradle(Project:xxxx)
buildscript { repositorIEs { Google() jcenter() //jcenter引用 } dependencIEs { //声明Gradle编译插件 classpath 'com.androID.tools.build:gradle:3.6.3' }}allprojects { repositorIEs { Google() jcenter() }}task clean(type: Delete) { delete rootProject.buildDir}
build.gradle(Module:app)
//表示这是一个应用程序模块apply plugin: 'com.androID.application'//com.androID.alibrary:表示库模块androID { //编译版本 compileSdkVersion 29 //项目构建工具版本 buildToolsversion "29.0.3" //项目细节配置 defaultConfig { //指定项目包名 applicationID "com.example.test" //最低兼容版本 minSdkVersion 16 //经过测试的版本 targetSdkVersion 29 //指定项目版本号 versionCode 1 //指定项目版本名 versionname "1.0" testInstrumentationRunner "androIDx.test.runner.AndroIDJUnitRunner" } //生成安装文件配置 buildTypes { //生产正式版本文件配置 release { //是否代码混淆 MinifyEnabled false //指定混淆规则文件 proguardfiles getDefaultProguardfile('proguard-androID-optimize.txt'), 'proguard-rules.pro' } }}//依赖关系配置dependencIEs { //本地依赖(libs目录下的所有后缀为jar文件) implementation filetree(dir: 'libs', include: ['*.jar']) implementation 'androIDx.appcompat:appcompat:1.0.2' implementation 'androIDx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.12' androIDTestImplementation 'androIDx.test.ext:junit:1.1.1' androIDTestImplementation 'androIDx.test.espresso:espresso-core:3.2.0'}
总结 以上是内存溢出为你收集整理的Android Studio 项目文件及目录详解全部内容,希望文章能够帮你解决Android Studio 项目文件及目录详解所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)