• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

安卓逆向-34-AndroidStudio工程目录结构

android 搞代码 4年前 (2022-03-01) 37次浏览 已收录 0个评论
  • gradle -> wrapper -> gradle-wrapper.properties 配置我的项目gradle版本
  • build.gradle 形容工程整体的编译规定
  • gradle.properties gradle配置文件,个别毋庸改变
  • local.properties 本机环境配置,SDK、NDK门路等,个别毋庸改变
  • settings.gradle 配置哪些模块在一起编译 include ‘:app’ 只编译app

APP

  • app -> build.gradle 形容以后模块的编译规定
  • app -> build -> outputs -> apk -> debug/release 生成的apk的寄存地位
  • app -> build -> intermediates -> cmake -> debug/release -> obj 生成的so寄存地位
  • libs 模块中应用了第三方jar的时候,会放这里
src -> main -> cpp      C/C++代码
               java     Java代码
  • src -> proguard-rules.pro Java代码混同规定
  • src -> main -> res -> drawable 用来放图片
  • src -> main -> res -> layout 用来放布局文件
  • src -> main -> res -> mipmap-hdpi 用来放利用图片,不同屏幕的适配图标
  • src -> main -> res -> values strings.xml、public.xml
  • src -> main -> AndroidManifest.xml 清单文件,app的icon图标、四大组件的注册、权限申请、指明程序入口

build.gradle 课件版本

plugins {
    id 'com.android.application'
}

android {
    //指定编译用的SDK版本号
    compileSdkVersion 30
    //指定编译工具的版本号,结尾两位数字必须与compileSdkVersion统一。具体版本号可在sdk装置目录 SDK\build-tools 下找到
    buildToolsVersion "30.0.3"

    defaultConfig {
        //app包名
        applicationId "com.xiaojianbang.hashmaptest"
        //app适宜运行的最小SDK版本号
        minSdkVersion 16
        //指标设施的SDK版本号,即app心愿在哪个版本下运行
        targetSdkVersion 30
        //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.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    api 'com.squareup.okhttp3:okhttp:3.10.0'

}

build.gradle 本人复制的

plugins {
    id 'com.android.application'
}

android {
    //指定编译用的SDK版本号
    compileSdk 31

    defaultConfig {
        //app包名
        applicationId "com.hengdi.hookdemo"
        //app适宜运行的最小SDK版本号
        minSdk 21
        //指标设施的SDK版本号,即app心愿在哪个版本下运行
        targetSdk 31
        //app利用版本号
        versionCode 1
         //app利用版本名称
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        // c++ 我的项目  会有对应的c++版本
        externalNativeBuild {
            cmake {
                cppFlags '-std=c++11'
            }
        }
    }

    buildTypes {
        release {
            //是否开启代码混同性能
            minifyEnabled false
            //指定代码混同规定文件名
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    externalNativeBuild {
        cmake {
            // cmake 列表
            path file('src/main/cpp/CMakeLists.txt')
            version '3.10.2'
        }
    }
    buildFeatures {
        viewBinding true
    }
}
//配置app编译所需依赖
dependencies {

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:安卓逆向-34-AndroidStudio工程目录结构
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址