Android基础框架

WeBuzzProject
一款项目的基础框架搭建
主要运用mvp模式编程+相关插件的运用,可复用借鉴到自己项目中去

基本架构Architecture

  • 主流框架:Glide + Retrofit + RxJava2.0 + butterknife
  • 采用MVP模式进行解耦

本项目用到的主要开源库Dependencies

  • Butterknife
  • Glide
  • Rxjava2
  • Retrofit
  • Fragmention
  • Bugly
  • RxPapazzo
  • DBFlow
  • AndroidUtilCode
  • SHSegmentControl
  • logger
  • RxPermission

设计相关代码:

  • MultiDex/Logger /CrashReport/FlowManager/Rxpaparazzo初始化
MultiDex.install(this);
Logger.addLogAdapter(new AndroidLogAdapter());
CrashReport.initCrashReport(this, "fe25273ca", true);
FlowManager.init(this);
RxPaparazzo.register(this);
  • 定义apk名字
  applicationVariants.all { variant ->
                variant.outputs.each { output ->
                    def outputFile = output.outputFile
                    // 获取渠道
                    def flavor = variant.productFlavors[0]
                    def flavorName
                    if (flavor == null) {
                        flavorName = "webuzz"
                    } else {
                        flavorName = flavor.name
                    }

                    if (outputFile != null && outputFile.name.endsWith('.apk')) {
                        def fileName = "webuzz_v${defaultConfig.versionName}_${buildTime()}_${flavorName}.apk"
                        output.outputFile = new File(outputFile.parent, fileName)
                    }
                }
            }

Github地址

你可能感兴趣的:(实用项目)