Skip to content

Commit c804c4f

Browse files
authored
Update sample app and documentation (#22)
* feat: Update sample app theme and icons * feat: Update README
1 parent d53aa4e commit c804c4f

21 files changed

+120
-250
lines changed

README.md

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,11 @@ WhatTheStack is a library to make your debugging experience on Android better.
66

77
It shows you a pretty error screen when your Android App crashes, instead of a boring old dialog saying "Unfortunately, \<your-app\> has crashed".
88

9-
## Setup
10-
11-
Follow the [Installation Instructions](#installation) to set it up.
12-
13-
_Remember to use WhatTheStack only in debug builds of your app by using `debugImplementation` instead of `implementation.`_
14-
15-
Now when an uncaught exception is thrown in your application, you will be greeted with a screen similar to this:
16-
17-
<img src="media/screenshot.jpeg" width="360px" height="640px"/>
9+
![Demo](media/demo.gif)
1810

19-
### Disabling automatic initialization
20-
21-
`WhatTheStack` initializes automatically when your application starts. It accomplishes this using Jetpack's App Startup library.
22-
23-
If you want to disable automatic startup, add the following lines to your Manifest file:
24-
25-
```xml
26-
<provider
27-
android:name="androidx.startup.InitializationProvider"
28-
android:authorities="${applicationId}.androidx-startup"
29-
android:exported="false"
30-
tools:node="merge">
31-
<meta-data android:name="com.haroldadmin.whatthestack.WhatTheStackInitializer"
32-
android:value="androidx.startup"
33-
tools:node="remove"/>
34-
</provider>
35-
```
36-
37-
## Under the hood
38-
39-
This library works by setting a default `UncaughtExceptionHandler` on your app, and running a service to receive notifications about thrown exceptions.
40-
41-
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 information about the exception.
42-
43-
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.
44-
45-
## Impact on Crashlytics
46-
47-
WhatTheStack works by replacing the default uncaught exception handler in your app's process. Unfortunately, crash reporting libraries such as Firebase Crashlytics also work in this manner.
48-
Since there can only be one default uncaught exception handler, WhatTheStack might break crash reporting libraries from working properly in debug builds.
49-
50-
This _should not be a problem for most users_ as crash reporting tools are rarely used in debug builds.
11+
## Setup
5112

52-
## Installation
13+
[![Release](https://jitpack.io/v/haroldadmin/WhatTheStack.svg)](https://jitpack.io/#haroldadmin/WhatTheStack)
5314

5415
Add Jitpack repository in your root `build.gradle` file:
5516

@@ -69,10 +30,56 @@ dependencies {
6930
}
7031
```
7132

72-
It is not recommended to use WhatTheStack in anything other than debug builds of your app. Only use `debugImplementation` when adding this dependency.
33+
Now when an uncaught exception is thrown in your application, you will be greeted with a screen containing information about the crash. We support light and dark themes too!
7334

74-
[![Release](https://jitpack.io/v/haroldadmin/WhatTheStack.svg)](https://jitpack.io/#haroldadmin/WhatTheStack)
35+
<img src="media/screenshot-dark.png" width="360px" height="640px"/>
36+
<img src="media/screenshot-light.png" width="360px" height="640px"/>
37+
38+
## Usage
39+
40+
WhatTheStack works by overriding the default exception handler in your app. It processes any uncaught exception in your app, parses it to extract useful information, and then shows it in a pretty screen.
41+
42+
### Automatic Initialization
43+
44+
WhatTheStack uses the [Jetpack App Startup](https://developer.android.com/topic/libraries/app-startup) library to run automatically when your app starts. You don't need to write any code to initialize it manually.
45+
46+
<details>
47+
<summary>Need to disable automatic initialization?</summary>
48+
If you want to disable automatic startup, add the following lines to your Manifest file:
49+
50+
```xml
51+
<provider
52+
android:name="androidx.startup.InitializationProvider"
53+
android:authorities="${applicationId}.androidx-startup"
54+
android:exported="false"
55+
tools:node="merge">
56+
<meta-data android:name="com.haroldadmin.whatthestack.WhatTheStackInitializer"
57+
android:value="androidx.startup"
58+
tools:node="remove"/>
59+
</provider>
60+
```
61+
</details>
62+
63+
### Debug vs Release builds
64+
65+
We recommend using `WhatTheStack` in debug builds only. We see it as a tool to improve the experience of the developer, not the user.
66+
67+
<details>
68+
<summary>Need to use it in release builds?</summary>
69+
If you want to use WhatTheStack in release builds, replace the `debugImplementation` dependency with `implementation'.
70+
71+
```diff
72+
dependencies {
73+
- debugImplementation 'com.github.haroldadmin:WhatTheStack:(latest-version)'
74+
+ implementation 'com.github.haroldadmin:WhatTheStack:(latest-version)'
75+
}'
76+
```
77+
78+
The library ships with Proguard rules to ensure that it works correctly even after minification.
79+
</details>
7580

7681
## Contributions
7782

78-
Contributions to this library are very welcome.
83+
We are happy to accept any external contributions in the form of PRs, issues, or blog posts.
84+
85+
Please consider starring the repository if you find it useful or intriguing!

app/src/main/res/drawable-v24/ic_launcher_foreground.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 9 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,15 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<vector xmlns:android="http://schemas.android.com/apk/res/android"
32
android:width="108dp"
43
android:height="108dp"
54
android:viewportWidth="108"
65
android:viewportHeight="108">
7-
<path
8-
android:fillColor="#3DDC84"
9-
android:pathData="M0,0h108v108h-108z" />
10-
<path
11-
android:fillColor="#00000000"
12-
android:pathData="M9,0L9,108"
13-
android:strokeWidth="0.8"
14-
android:strokeColor="#33FFFFFF" />
15-
<path
16-
android:fillColor="#00000000"
17-
android:pathData="M19,0L19,108"
18-
android:strokeWidth="0.8"
19-
android:strokeColor="#33FFFFFF" />
20-
<path
21-
android:fillColor="#00000000"
22-
android:pathData="M29,0L29,108"
23-
android:strokeWidth="0.8"
24-
android:strokeColor="#33FFFFFF" />
25-
<path
26-
android:fillColor="#00000000"
27-
android:pathData="M39,0L39,108"
28-
android:strokeWidth="0.8"
29-
android:strokeColor="#33FFFFFF" />
30-
<path
31-
android:fillColor="#00000000"
32-
android:pathData="M49,0L49,108"
33-
android:strokeWidth="0.8"
34-
android:strokeColor="#33FFFFFF" />
35-
<path
36-
android:fillColor="#00000000"
37-
android:pathData="M59,0L59,108"
38-
android:strokeWidth="0.8"
39-
android:strokeColor="#33FFFFFF" />
40-
<path
41-
android:fillColor="#00000000"
42-
android:pathData="M69,0L69,108"
43-
android:strokeWidth="0.8"
44-
android:strokeColor="#33FFFFFF" />
45-
<path
46-
android:fillColor="#00000000"
47-
android:pathData="M79,0L79,108"
48-
android:strokeWidth="0.8"
49-
android:strokeColor="#33FFFFFF" />
50-
<path
51-
android:fillColor="#00000000"
52-
android:pathData="M89,0L89,108"
53-
android:strokeWidth="0.8"
54-
android:strokeColor="#33FFFFFF" />
55-
<path
56-
android:fillColor="#00000000"
57-
android:pathData="M99,0L99,108"
58-
android:strokeWidth="0.8"
59-
android:strokeColor="#33FFFFFF" />
60-
<path
61-
android:fillColor="#00000000"
62-
android:pathData="M0,9L108,9"
63-
android:strokeWidth="0.8"
64-
android:strokeColor="#33FFFFFF" />
65-
<path
66-
android:fillColor="#00000000"
67-
android:pathData="M0,19L108,19"
68-
android:strokeWidth="0.8"
69-
android:strokeColor="#33FFFFFF" />
70-
<path
71-
android:fillColor="#00000000"
72-
android:pathData="M0,29L108,29"
73-
android:strokeWidth="0.8"
74-
android:strokeColor="#33FFFFFF" />
75-
<path
76-
android:fillColor="#00000000"
77-
android:pathData="M0,39L108,39"
78-
android:strokeWidth="0.8"
79-
android:strokeColor="#33FFFFFF" />
80-
<path
81-
android:fillColor="#00000000"
82-
android:pathData="M0,49L108,49"
83-
android:strokeWidth="0.8"
84-
android:strokeColor="#33FFFFFF" />
85-
<path
86-
android:fillColor="#00000000"
87-
android:pathData="M0,59L108,59"
88-
android:strokeWidth="0.8"
89-
android:strokeColor="#33FFFFFF" />
90-
<path
91-
android:fillColor="#00000000"
92-
android:pathData="M0,69L108,69"
93-
android:strokeWidth="0.8"
94-
android:strokeColor="#33FFFFFF" />
95-
<path
96-
android:fillColor="#00000000"
97-
android:pathData="M0,79L108,79"
98-
android:strokeWidth="0.8"
99-
android:strokeColor="#33FFFFFF" />
100-
<path
101-
android:fillColor="#00000000"
102-
android:pathData="M0,89L108,89"
103-
android:strokeWidth="0.8"
104-
android:strokeColor="#33FFFFFF" />
105-
<path
106-
android:fillColor="#00000000"
107-
android:pathData="M0,99L108,99"
108-
android:strokeWidth="0.8"
109-
android:strokeColor="#33FFFFFF" />
110-
<path
111-
android:fillColor="#00000000"
112-
android:pathData="M19,29L89,29"
113-
android:strokeWidth="0.8"
114-
android:strokeColor="#33FFFFFF" />
115-
<path
116-
android:fillColor="#00000000"
117-
android:pathData="M19,39L89,39"
118-
android:strokeWidth="0.8"
119-
android:strokeColor="#33FFFFFF" />
120-
<path
121-
android:fillColor="#00000000"
122-
android:pathData="M19,49L89,49"
123-
android:strokeWidth="0.8"
124-
android:strokeColor="#33FFFFFF" />
125-
<path
126-
android:fillColor="#00000000"
127-
android:pathData="M19,59L89,59"
128-
android:strokeWidth="0.8"
129-
android:strokeColor="#33FFFFFF" />
130-
<path
131-
android:fillColor="#00000000"
132-
android:pathData="M19,69L89,69"
133-
android:strokeWidth="0.8"
134-
android:strokeColor="#33FFFFFF" />
135-
<path
136-
android:fillColor="#00000000"
137-
android:pathData="M19,79L89,79"
138-
android:strokeWidth="0.8"
139-
android:strokeColor="#33FFFFFF" />
140-
<path
141-
android:fillColor="#00000000"
142-
android:pathData="M29,19L29,89"
143-
android:strokeWidth="0.8"
144-
android:strokeColor="#33FFFFFF" />
145-
<path
146-
android:fillColor="#00000000"
147-
android:pathData="M39,19L39,89"
148-
android:strokeWidth="0.8"
149-
android:strokeColor="#33FFFFFF" />
150-
<path
151-
android:fillColor="#00000000"
152-
android:pathData="M49,19L49,89"
153-
android:strokeWidth="0.8"
154-
android:strokeColor="#33FFFFFF" />
155-
<path
156-
android:fillColor="#00000000"
157-
android:pathData="M59,19L59,89"
158-
android:strokeWidth="0.8"
159-
android:strokeColor="#33FFFFFF" />
160-
<path
161-
android:fillColor="#00000000"
162-
android:pathData="M69,19L69,89"
163-
android:strokeWidth="0.8"
164-
android:strokeColor="#33FFFFFF" />
165-
<path
166-
android:fillColor="#00000000"
167-
android:pathData="M79,19L79,89"
168-
android:strokeWidth="0.8"
169-
android:strokeColor="#33FFFFFF" />
6+
<group android:scaleX="0.2109375"
7+
android:scaleY="0.2109375">
8+
<path
9+
android:pathData="M0.5,0.5h511v511h-511z"
10+
android:strokeWidth="1"
11+
android:fillColor="#D32F2F"
12+
android:strokeColor="#979797"
13+
android:fillType="evenOdd"/>
14+
</group>
17015
</vector>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="108"
5+
android:viewportHeight="108">
6+
<group android:scaleX="0.10546875"
7+
android:scaleY="0.10546875"
8+
android:translateX="27"
9+
android:translateY="27">
10+
<path
11+
android:pathData="M261.56,136.597L425.149,300.186C428.273,303.31 428.273,308.375 425.149,311.5L261.56,475.089C258.435,478.213 253.37,478.213 250.246,475.089L86.657,311.5C83.533,308.375 83.533,303.31 86.657,300.186L250.246,136.597C253.37,133.473 258.435,133.473 261.56,136.597Z"
12+
android:strokeLineJoin="round"
13+
android:strokeWidth="8"
14+
android:fillColor="#D32F2F"
15+
android:strokeColor="#FFFFFF"
16+
android:fillType="evenOdd"
17+
android:strokeLineCap="round"/>
18+
<path
19+
android:pathData="M262.267,87.834L424.441,250.009C427.956,253.523 427.956,259.222 424.441,262.737L262.267,424.911C258.752,428.426 253.053,428.426 249.539,424.911L87.364,262.737C83.849,259.222 83.849,253.523 87.364,250.009L249.539,87.834C253.053,84.319 258.752,84.319 262.267,87.834Z"
20+
android:strokeLineJoin="round"
21+
android:strokeWidth="8"
22+
android:fillColor="#D32F2F"
23+
android:strokeColor="#FFFFFF"
24+
android:fillType="evenOdd"/>
25+
<path
26+
android:pathData="M261.56,37.657L425.149,201.246C428.273,204.37 428.273,209.436 425.149,212.56L261.56,376.149C258.436,379.273 253.37,379.273 250.246,376.149L86.657,212.56C83.533,209.436 83.533,204.37 86.657,201.246L250.246,37.657C253.37,34.533 258.436,34.533 261.56,37.657Z"
27+
android:strokeWidth="1"
28+
android:fillColor="#000000"
29+
android:fillType="evenOdd"
30+
android:strokeColor="#00000000"/>
31+
<path
32+
android:pathData="M258.731,40.485C257.169,38.923 254.636,38.923 253.074,40.485L89.485,204.074C87.923,205.636 87.923,208.169 89.485,209.731L253.074,373.32C254.636,374.882 257.169,374.882 258.731,373.32L422.32,209.731C423.882,208.169 423.882,205.636 422.32,204.074L258.731,40.485Z"
33+
android:strokeLineJoin="round"
34+
android:strokeWidth="8"
35+
android:fillColor="#FFFFFF"
36+
android:fillType="evenOdd"
37+
android:strokeColor="#FFFFFF"/>
38+
</group>
39+
</vector>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3-
<background android:drawable="@drawable/ic_launcher_background" />
4-
<foreground android:drawable="@drawable/ic_launcher_foreground" />
3+
<background android:drawable="@drawable/ic_launcher_background"/>
4+
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
55
</adaptive-icon>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3-
<background android:drawable="@drawable/ic_launcher_background" />
4-
<foreground android:drawable="@drawable/ic_launcher_foreground" />
3+
<background android:drawable="@drawable/ic_launcher_background"/>
4+
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
55
</adaptive-icon>
-1.93 KB
Loading
-1.81 KB
Loading
-1.47 KB
Loading
-1.14 KB
Loading

0 commit comments

Comments
 (0)