-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# NeverCrash | ||
[![Download](https://img.shields.io/badge/download-App-blue.svg)](https://raw.githubusercontent.com/jenly1314/NeverCrash/master/app/app-release.apk) | ||
[![](https://jitpack.io/v/jenly1314/NeverCrash.svg)](https://jitpack.io/#jenly1314/NeverCrash) | ||
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/mit-license.php) | ||
[![Blog](https://img.shields.io/badge/blog-Jenly-9933CC.svg)](http://blog.csdn.net/jenly121) | ||
|
||
NeverCrash for Android 一个全局捕获Crash的库。信NeverCrash,永不Crash,。 | ||
|
||
## Gif 展示 | ||
![Image](GIF.gif) | ||
|
||
## 引入 | ||
|
||
### Maven: | ||
``` | ||
<dependency> | ||
<groupId>com.king.thread</groupId> | ||
<artifactId>nevercrash</artifactId> | ||
<version>1.0.0</version> | ||
<type>pom</type> | ||
</dependency> | ||
``` | ||
### Gradle: | ||
``` | ||
compile 'com.king.thread:nevercrash:1.0.0' | ||
``` | ||
### Lvy: | ||
``` | ||
<dependency org='com.king.thread' name='nevercrash' rev='1.0.0'> | ||
<artifact name='$AID' ext='pom'></artifact> | ||
</dependency> | ||
``` | ||
|
||
## 示例 | ||
|
||
核心代码(大道至简) | ||
```Java | ||
NeverCrash.init(CrashHandler); | ||
``` | ||
|
||
代码示例 | ||
```Java | ||
public class App extends Application { | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
NeverCrash.init(new NeverCrash.CrashHandler() { | ||
@Override | ||
public void uncaughtException(Thread t, Throwable e) { | ||
Log.d("Jenly", Log.getStackTraceString(e)); | ||
// e.printStackTrace(); | ||
showToast(e.getMessage()); | ||
|
||
|
||
} | ||
}); | ||
} | ||
|
||
private void showToast(final String text){ | ||
|
||
new Handler(Looper.getMainLooper()).post(new Runnable() { | ||
@Override | ||
public void run() { | ||
Toast.makeText(getApplicationContext(),text,Toast.LENGTH_SHORT).show(); | ||
} | ||
}); | ||
} | ||
|
||
} | ||
``` | ||
|
||
## 关于我 | ||
Name: Jenly | ||
|
||
Email: jenly1314@gmail.com / jenly1314@vip.qq.com | ||
|
||
CSDN: http://www.csdn.net/jenly121 | ||
|
||
Github: https://github.com/jenly1314 | ||
|
||
微信公众号: | ||
|
||
![公众号](http://olambmg9j.bkt.clouddn.com/jenly666.jpg) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.2" | ||
defaultConfig { | ||
applicationId "com.king.nevercrash" | ||
minSdkVersion 15 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(include: ['*.jar'], dir: 'libs') | ||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
compile 'com.android.support:appcompat-v7:25.3.0' | ||
compile 'com.android.support.constraint:constraint-layout:1.0.2' | ||
testCompile 'junit:junit:4.12' | ||
compile project(':lib') | ||
} |