Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jenly1314 committed Apr 13, 2017
0 parents commit 4e9a760
Show file tree
Hide file tree
Showing 49 changed files with 1,156 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
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
22 changes: 22 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions .idea/markdown-navigator.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/markdown-navigator/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions README.md
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)
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Binary file added app/app-release.apk
Binary file not shown.
31 changes: 31 additions & 0 deletions app/build.gradle
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')
}
Loading

0 comments on commit 4e9a760

Please sign in to comment.