如果要你独自搭建一个android项目的基础架构,你会怎么做?我们来看一下需要考虑哪些方面?
1.模块化、组件化 我们将业务细分到很小的细粒度,比如登录注册、用户中心都可以单独创建一个module。我们使用gradle进行选择性依赖,打包时也可以打单独的aar包,然后我们通过路由框架将这些模块联系起来。
2.换肤、切换暗色主题 3.国际化,切换语言 4.离线数据缓存,在用户断开网络连接的时候,使用历史的缓存数据进行展示,而非您的网络断开了的空态页面 5.版本更新,全量更新、热更新、增量更新 6.启动引导页 7.埋点和统计 8.日志与bug收集 9.数据加密AES、RSA
常用的库有
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
implementation 'com.squareup.okhttp3:okhttp:4.8.0'
implementation 'com.squareup.retrofit2:retrofit:2.7.2'
implementation 'com.squareup.retrofit2:converter-gson:2.7.2'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.2'
implementation 'io.reactivex.rxjava2:rxjava:2.0.4'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.github.bumptech.glide:glide:4.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
implementation 'com.github.hackware1993:MagicIndicator:1.6.0'
implementation 'com.google.zxing:core:3.4.0'
implementation 'top.zibin:Luban:1.1.8'
implementation 'com.airbnb.android:lottie:3.3.1'
implementation 'q.rorbin:badgeview:1.1.3'