Skip to content

Commit 36effe2

Browse files
Version 1.1.0
- Added support for file attachments and annotations - Added battery level and status attributes - Added screen brightness attribute - Fixed Android version attribute - Fixed bug with negative number of lines in stacktrace - Filtered out the frames from the Backtrace library - Simplified BacktraceClient class, removed 'send' and 'async' methods overwrites - Replaced spaces with underscore in all enums strings
2 parents 81daf21 + 5bb4ea2 commit 36effe2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1381
-183
lines changed

.gitignore

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,86 @@
1+
# [Android] ========================
2+
# Built application files
3+
*.apk
4+
*.ap_
5+
6+
# Files for the Dalvik VM
7+
*.dex
8+
9+
# Java class files
110
*.class
211

12+
# Generated files
13+
bin/
14+
gen/
15+
16+
# Gradle files
17+
.gradle/
18+
build/
19+
20+
# Local configuration file (sdk path, etc)
21+
local.properties
22+
23+
# Proguard folder generated by Eclipse
24+
proguard/
25+
26+
# Log Files
27+
*.log
28+
29+
30+
## Directory-based project format:
31+
.idea/
32+
33+
## File-based project format:
34+
*.ipr
35+
*.iws
36+
37+
## Plugin-specific files:
38+
39+
# IntelliJ
40+
out/
41+
42+
# mpeltonen/sbt-idea plugin
43+
.idea_modules/
44+
45+
# JIRA plugin
46+
atlassian-ide-plugin.xml
47+
48+
# Crashlytics plugin (for Android Studio and IntelliJ)
49+
com_crashlytics_export_strings.xml
50+
51+
52+
# [Maven] ========================
53+
target/
54+
pom.xml.tag
55+
pom.xml.releaseBackup
56+
pom.xml.versionsBackup
57+
pom.xml.next
58+
release.properties
59+
60+
61+
# [Gradle-Android] ========================
62+
63+
# Ignore Gradle GUI config
64+
gradle-app.setting
65+
66+
# Gradle Signing
67+
signing.properties
68+
trestle.keystore
69+
370
# Mobile Tools for Java (J2ME)
471
.mtj.tmp/
572

673
# Package Files #
74+
*.jar
775
*.war
876
*.ear
977

1078
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
1179
hs_err_pid*
1280

13-
local.properties
14-
build/
15-
.gradle/
16-
.idea
17-
*.iml
81+
# Misc
82+
/.idea/workspace.xml
83+
.DS_Store
84+
/captures
85+
**/*.iml
86+
*.class

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Backtrace Android Release Notes
2+
3+
## Version 1.1.0 - 25.02.2019
4+
- Added support for file attachments and annotations
5+
- Added battery level and status attributes
6+
- Added screen brightness attribute
7+
- Fixed Android version attribute
8+
- Fixed bug with negative number of lines in stacktrace
9+
- Filtered out the frames from the Backtrace library
10+
- Simplified BacktraceClient class, removed 'send' and 'async' methods overwrites
11+
- Replaced spaces with underscore in all enums strings
12+
13+
## Version 1.0 - 27.01.2019
14+
- First release.

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018 Backtrace I/O, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the "Software"),
5+
to deal in the Software without restriction, including without limitation
6+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
7+
and/or sell copies of the Software, and to permit persons to whom the Software
8+
is furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
[Backtrace](http://backtrace.io/)'s integration with Android applications written in Java allows customers to capture and report handled and unhandled java exceptions to their Backtrace instance, instantly offering the ability to prioritize and debug software errors.
14+
[Backtrace](http://backtrace.io/)'s integration with Android applications written in Java or Kotlin which allows customers to capture and report handled and unhandled java exceptions to their Backtrace instance, instantly offering the ability to prioritize and debug software errors.
1515

1616

1717
## Usage
@@ -52,39 +52,53 @@ catch (e: Exception) {
5252
7. [Architecture](#architecture)
5353

5454

55-
# Download
56-
Gradle
55+
# Features Summary <a name="features-summary"></a>
56+
* Light-weight Java client library that quickly submits exceptions and crashes to your Backtrace dashboard. Can include callstack, system metadata, custom metadata and file attachments if needed.<!--, and file attachments if needed.-->
57+
* Supports a wide range of Android SDKs.
58+
* Supports asynchronous Tasks.
59+
* Fully customizable and extendable event handlers and base classes for custom implementations.
60+
61+
# Supported SDKs <a name="supported-sdks"></a>
62+
* Minimal SDK version 19 (Android 4.4)
63+
* Target SDK version 28 (Android 9.0)
64+
65+
# Differences and limitations of the SDKs version <a name="limitations"></a>
66+
* Getting the status that the device is in power saving mode is available from API 21.
67+
68+
# Installation <a name="installation"></a>
69+
## Download library via Gradle or Maven
70+
* Gradle
5771
```
5872
dependencies {
59-
implementation 'com.github.backtrace-labs.backtrace-android:backtrace-library:1.0'
73+
implementation 'com.github.backtrace-labs.backtrace-android:backtrace-library:1.1.0'
6074
}
6175
```
6276

63-
Maven
77+
* Maven
6478
```
6579
<dependency>
6680
<groupId>com.github.backtrace-labs.backtrace-android</groupId>
6781
<artifactId>backtrace-library</artifactId>
68-
<version>1.0</version>
82+
<version>1.1.0</version>
6983
<type>aar</type>
7084
</dependency>
7185
```
7286

73-
# Features Summary <a name="features-summary"></a>
74-
* Light-weight Java client library that quickly submits exceptions and crashes to your Backtrace dashboard. Can include callstack, system metadata, custom metadata.<!--, and file attachments if needed.-->
75-
* Supports a wide range of Android SDKs.
76-
* Supports asynchronous Tasks.
77-
* Fully customizable and extendable event handlers and base classes for custom implementations.
87+
## Permissions
88+
### Internet permission
89+
* To send errors to the server instance you need to add permissions for Internet connection into `AndroidManifest.xml` file in your application.
7890

91+
```xml
92+
<uses-permission android:name="android.permission.INTERNET" />
93+
```
7994

80-
# Differences and limitations of the SDKs version <a name="limitations"></a>
95+
### File access
96+
* To send file attachments from external storage to the server instance you need to add permissions for read external storage into `AndroidManifest.xml` file in your application.
8197

82-
# Supported SDKs <a name="supported-sdks"></a>
83-
* Minimal SDK version 19 (Android 4.4)
84-
* Target SDK version 28 (Android 9.0)
98+
```xml
99+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
100+
```
85101

86-
# Installation <a name="installation"></a>
87-
TODO
88102

89103
# Running sample application
90104
## Android Studio <a name="sample-app-android-studio"></a>
@@ -142,8 +156,8 @@ try {
142156
new HashMap<String, Object>() {{
143157
put("key", "value");
144158
}}, new ArrayList<String>() {{
145-
add("file_path_1");
146-
add("file_path2");
159+
add("absoulte_file_path_1");
160+
add("absoulte_file_path_2");
147161
}});
148162
backtraceClient.send(report);
149163
}
@@ -155,12 +169,12 @@ try {
155169
// throw exception here
156170
}
157171
catch (e: Exception) {
158-
val report = BacktraceReport(e, mapOf("key" to "value"), listOf("file_path_1", "file_path_2"))
172+
val report = BacktraceReport(e, mapOf("key" to "value"), listOf("absolute_file_path_1", "absolute_file_path_2"))
159173
backtraceClient.send(report)
160174
}
161175
```
162176

163-
#### Asynchronous Send Support
177+
### Asynchronous Send support
164178

165179
Method `send` behind the mask use `AsyncTask` and wait until method `doInBackground` is not completed. Library gives you the option of not blocking code execution by using method `sendAsync` which returning the `AsyncTask<Void, Void, BacktraceResult>` object. Additionally, it is possible to specify the method that should be performed after completion `AsyncTask` by using events described in [events](#events).
166180

@@ -179,7 +193,7 @@ val sendAsyncTask = backtraceClient.sendAsync(report)
179193
val result = asynctask.get()
180194
```
181195

182-
### Other BacktraceReport Overloads
196+
### Other BacktraceReport overloads
183197

184198
`BacktraceClient` can also automatically create `BacktraceReport` given an exception or a custom message using the following overloads of the `BacktraceClient.send` or `BacktraceClient.sendAsync` methods:
185199

@@ -268,14 +282,10 @@ You can extend `BacktraceBase` to create your own Backtrace client and error rep
268282

269283
## BacktraceApi <a name="architecture-BacktraceApi"></a>
270284
**`BacktraceApi`** is a class that sends diagnostic JSON to the Backtrace endpoint. `BacktraceApi` is instantiated when the `BacktraceClient` constructor is called. You use the following event handlers in `BacktraceApi` to customize how you want to handle JSON data:
271-
- `RequestHandler` - attach an event handler to this event to override the default `BacktraceApi.send` method. <!--A `RequestHandler` TODO -->
272-
- `OnServerError` - attach an event handler to be invoked when the server returns with a `400 bad request`, `401 unauthorized` or other HTTP error codes. <!-- TODO -->
285+
- `RequestHandler` - attach an event handler to this event to override the default `BacktraceApi.send` and `BacktraceApi.sendAsync` methods.
286+
- `OnServerError` - attach an event handler to be invoked when the server returns with a `400 bad request`, `401 unauthorized` or other HTTP error codes.
273287
- `OnServerResponse` - attach an event handler to be invoked when the server returns with a valid response.
274288

275289

276290
## BacktraceResult <a name="architecture-BacktraceResult"></a>
277-
**`BacktraceResult`** is a class that holds response and result from a `send` or `sendAsync` call. The class contains a `Status` property that indicates whether the call was completed (`OK`), the call returned with an error (`ServerError`), . Additionally, the class has a `Message` property that contains details about the status.
278-
279-
280-
281-
291+
**`BacktraceResult`** is a class that holds response and result from a `send` or `sendAsync` call. The class contains a `Status` property that indicates whether the call was completed (`OK`), the call returned with an error (`ServerError`), . Additionally, the class has a `Message` property that contains details about the status.

backtrace-library/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ android {
77
minSdkVersion 19
88
targetSdkVersion 28
99
versionCode 1
10-
versionName "1.0"
10+
versionName "1.1.0"
1111
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1212
}
1313

@@ -26,5 +26,7 @@ dependencies {
2626
implementation 'com.android.support:appcompat-v7:28.0.0'
2727
testImplementation 'junit:junit:4.12'
2828
androidTestImplementation 'com.android.support.test:runner:1.0.2'
29+
androidTestImplementation 'com.android.support.test:rules:1.0.2'
30+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
2931
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
3032
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_NAME=Backtrace-library
2+
POM_ARTIFACT_ID=backtrace-library
3+
POM_PACKAGING=aar

backtrace-library/src/androidTest/java/backtraceio/library/EventsInstrumentedTest.java renamed to backtrace-library/src/androidTest/java/backtraceio/library/BacktraceClientEventsTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package backtraceio.library;
22

33
import android.content.Context;
4+
import android.os.AsyncTask;
45
import android.support.test.InstrumentationRegistry;
56
import android.support.test.runner.AndroidJUnit4;
67

@@ -10,6 +11,7 @@
1011

1112
import java.util.ArrayList;
1213
import java.util.UUID;
14+
import java.util.concurrent.ExecutionException;
1315

1416
import backtraceio.library.events.OnBeforeSendEventListener;
1517
import backtraceio.library.events.OnServerErrorEventListener;
@@ -27,7 +29,7 @@
2729
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
2830
*/
2931
@RunWith(AndroidJUnit4.class)
30-
public class EventsInstrumentedTest {
32+
public class BacktraceClientEventsTest {
3133
private Context context;
3234
private BacktraceCredentials credentials;
3335
private final String resultMessage = "From request handler";

0 commit comments

Comments
 (0)