===
allprojects {
repositories {
...
maven {
url 'https://jitpack.io'
// 1.1.3 新集成了蒲公英版本更新,crash 捕获的功能 必须添加下面这行
maven { url "https://raw.githubusercontent.com/Pgyer/mvn_repo_pgyer/master" }
}
}
}
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
//****************************必须保留start******************
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//****************************必须保留end******************
// 项目使用butterknife 必须添加这行
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
implementation 'com.github.kenxiong0113:MyBaseSDK:x.x.x'
}
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// 初始化base_utils_class
BaseLibrary.initBaseLibrary(this);
// 设置通知栏应用logo
BaseLibrary.setAppIcon(R.mipmap.ic_launcher);
}
}
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
...
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
public class MainActivity extends BaseToolBarActivity {
private static final String TAG = "MainActivity";
@BindView(R.id.et_scan)
EditText etScan;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected int getLayoutId() {
return R.layout.activity_main;
}
@Override
protected void initBase() {
}
@Override
protected void initView() {
}
@Override
protected void initListener() {
}
@Override
protected void initData() {
}
}
//关键代码:
UpdateAppVersionUtils.getInstance().checkAppVersion(this);
![]() |
![]() |
---|