Skip to content

Commit cb12995

Browse files
committed
feat: Update README
1 parent 003fda1 commit cb12995

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,24 @@ All that is needed to initialize this library is to use the `init()` method in t
1212
class MyApp : Application() {
1313
override fun onCreate() {
1414
super.onCreate()
15-
WhatTheStack(this).init()
15+
if (BuildConfig.DEBUG) {
16+
WhatTheStack(this).init()
17+
}
1618
}
1719
}
1820
```
1921

2022
And when an error is thrown in your application, you shall be greeted with a screen similar to this:
2123

22-
![ScreenShot](media/screenshot.jpeg)]
24+
<img src="media/screenshot.jpeg" width="360px" height="640px"/>
2325

2426
## Under the hood
2527

26-
This library works by setting a default uncaught-exception-handler on your app. When an uncaught exception is thrown, it is caught by this handler and sent to the library to parse and display to you. This is accomplished by running a bound service in a separate process than your app.
28+
This library works by setting a default `UncaughtExceptionHandler` on your app, and running a service to receive notifications about these exceptions.
2729

28-
Running in a separate process is important because when an uncaught exception is thrown, the main thread of your application becomes unable to perform an UI related actions, and hence can't launch an intent to display the error screen shipped with this library. Therefore, running in a separate process allows us to perform UI related actions even when the main thread of the app process has stopped.
30+
When an uncaught exception is thrown, it is caught by this handler and sent to the service running in a _different process than your application_ to parse and display the information about the exception to you.
31+
32+
Running in a separate process is important because when an uncaught exception is thrown, the main thread of your application becomes unable to perform any UI related actions, and hence can't launch an intent to display the error screen shipped with this library.
2933

3034
## Installation
3135

@@ -50,6 +54,8 @@ dependencies {
5054

5155
[![Release](https://jitpack.io/v/haroldadmin/WhatTheStack.svg)](https://jitpack.io/#haroldadmin/WhatTheStack)
5256

53-
## Contributing
57+
## Contributions
58+
59+
Contributions to this library are very welcome.
5460

55-
Contributions to this library are very welcome. I threw this together over one weekend, and it hasn't been thoroughly tested. Community validation and contributions would therefore be great.
61+
I threw this together over one weekend, and it hasn't been thoroughly tested. Community validation and contributions would therefore be great.

0 commit comments

Comments
 (0)