常用权限
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
常用依赖
// Retrofit库
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
//《RXjava2的适配器》
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
//《Rxjava2》
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
//Recyclerview
implementation 'com.android.support:recyclerview-v7:27.1.1'
//Fresco
implementation 'com.facebook.fresco:fresco:0.12.0'
implementation 'com.android.support:support-v4:27.1.1'
//Glide
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
//《RXjava2的适配器》
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
//《Rxjava2》
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
//Recyclerview
implementation 'com.android.support:recyclerview-v7:27.1.1'
//Fresco
implementation 'com.facebook.fresco:fresco:0.12.0'
implementation 'com.android.support:support-v4:27.1.1'
//Glide
implementation 'com.github.bumptech.glide:glide:3.7.0'
butterknife
implementation ‘com.jakewharton:butterknife:8.8.1’
annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’
imageloader包导入
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
Glide导入
implementation 'com.github.bumptech.glide:glide:3.7.0'
Fresco
implementation 'com.facebook.fresco:fresco:0.12.0'
二维码Zxing导入
implementation 'com.google.zxing:core:3.2.1'
implementation 'cn.yipianfengye.android:zxing-library:2.2'
TabLayout—design包导入
implementation 'com.android.support:design:24+'
OkHttp3导入
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
recyclerview 导入
implementation 'com.android.support:recyclerview-v7:26.1.0'
gson包导入
implementation 'com.google.code.gson:gson:2.2.4'
pull-to-refresh上下拉刷新控件
implementation 'com.github.userswlwork:pull-to-refresh:1.0.0'
Banner包的导入
implementation 'com.youth.banner:banner:1.4.10'
draggrid频道管理包导入
maven {url "https://jitpack.io"}
implementation 'com.github.andyoom:draggrid:v1.0.1'
一个Json串解析地址:
http://api.expoon.com/AppNews/getNewsList/type/1/p/1
多条目解析地址:
http://v.juhe.cn/toutiao/index?type=top&key=dbedecbcd1899c9785b95cc2d17131c5
一些图片地址:
http://img03.store.sogou.com/app/a/10010016/cfcba894e555937349610feb534dc72c
http://img02.store.sogou.com/app/a/10010016/5654ecf05c472d486d767d9ce5740fa7
http://www.touxiang.cn/uploads/20120518/18-092103_594.jpg
HttpClient处理方法
useLibrary 'org.apache.http.legacy'
导入依赖后与当前版本不符时在底部,最底部,最最最底部!!!复制下列代码
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '27.1.1' //27.1.1为现在的当前版本
}
}
}
}