Retrofit+Rxjava+jsoup 实现趣历史网站轻应用(一)

不跟你多BB,先上效果图了


写这篇文章在于总结一下自己当前使用的快速开发的框架,然后欢迎大家批评指正。

MVP实现大框架+rxjava响应式拉取+retrofit okhttp实现网络请求+joup实现网页解析


第一章就先介绍我的MVP的封装好了


MVP就不再赘述了,只提一点:

        为什么使用MVP模式?因为在Android中,Activity严重耦合了界面和数据获取层。这样不仅导致了Activity的类越来越庞大,而且,如果修改数据获取层,可能也导致整个View都要重写。也非常不利于模块和自动化测试。MVP使View独立于数据,把大量的逻辑从Activity中提取出来。把应用分层,每层都可以独立测试和变动。

先把gradle依赖贴出来

//项目创建时自动添加的依赖+recyclerview
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

//RxJava依赖
implementation "io.reactivex.rxjava2:rxjava:2.1.12"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'

//Retrofit依赖
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'

//Glide依赖
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'

//框架中baseActivity的子类的依赖
implementation 'me.yokeyword:fragmentation:1.3.3'

//Butter Knife依赖
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
</
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值