1.Banner轮播图(build.gradle)
dependencies {
implementation 'com.youth.banner:banner:1.4.10'
}
2.生成二维码(build.gradle)
dependencies {
implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.4'
}
3.RecycleView
implementation 'com.android.support:recyclerview-v7:28.0.0'
4.okhttp +日志拦截
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
5.XRecycleView
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
放入Build.gradle---->android下
(与‘compileSdkVersion’,‘defaultConfig’,‘buildTypes’标签为兄弟关系)
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'//根据你的底下appcompat-v7版本
}
}
}
}
6.Glide加载图片(功能跟imageloader相似)+用法
implementation 'com.github.bumptech.glide:glide:4.8.0'
/**
* Glide.with(上下文).load(路径).into(设置请求成功的图片);
*/
Glide.with(context).load(dataBean.getIcon()).into(viewHolder.image);
第三方登录(umeng)
//这个是网站,有详情见解
https://developer.umeng.com/docs/66632/detail/66639#h2-u7B2Cu4E09u65B9u767Bu5F5513?tdsourcetag=s_pcqq_aiomsg
//导入的权限
<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" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
//application中oncreat方法写的
UMConfigure.init(getApplicationContext(),"5a12384aa40fa3551f0001d1","umeng",UMConfigure.DEVICE_TYPE_PHONE,"");
PlatformConfig.setQQZone("100424468", "c7394704798a158208a74ab60104f0ba");
导入“activity标签中”
<!-- 3.写以下两个activity -->
<activity
android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tencent100424468" />
</intent-filter>
</activity>
<activity
android:name="com.tencent.connect.common.AssistActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="orientation|keyboardHidden|screenSize"/>
<!-- 3.写以下配置 -->
<meta-data android:name="UMENG_APPKEY"
android:value="5c07d385f1f556e5f90003c4">
</meta-data>
bugly
build.gradle
dependencies {
implementation 'com.tencent.bugly:crashreport:latest.release'
}
//权限
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_LOGS"
tools:ignore="ProtectedPermissions" />
//application中oncreat方法里的
//第二个参数是自己的APPID
CrashReport.initCrashReport(getApplicationContext(), "6aab0f2e10", false);
手机号验证
Pattern compile = compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
Matcher matcher = compile.matcher(text_phone);
return matcher.matches();