• Stars
    star
    402
  • Rank 106,715 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CrashReporter is a handy tool to capture app crashes and save them in a file.

CrashReporter

Mindorks Mindorks Community Android Arsenal API Download Open Source Love License

CrashReporter is a handy tool to capture app crashes and save them in a file.

Here is an article related to this library.

Why CrashReporter?

While developing features we get crashes and if device is not connected to logcat we miss the crash log. In worst case scenario we might not be able to reproduce the crash and endup wasting effort. This library captures all unhandled crashes and saves them locally on device. I found a problem with other libraries that they capture crashes and then uploads them to server and sometimes few crashes aren't logged to server. That's the purpose of this library use it as a debug feature to capture crashes locally and immediately.

Run the sample

Crash Reporter APIs

  • Track all crashes
  • Use Log Exception API to log Exception
  • All crashes and exceptions are saved in device
  • Choose your own path to save crash reports and exceptions
  • Share Instantly crash log with your team with other device data.

Crash reporter doesn't takes any permission or root access

Using Crash Reporter Library in your application

add below dependency in your app's gradle

compile 'com.balsikandar.android:crashreporter:1.1.0'

If you only want to use Crash reporter in debug builds only add

debugCompile 'com.balsikandar.android:crashreporter:1.1.0'

Note : If you get error like this "no resource identifier found for attribute 'alpha' in package 'android'" use below dependency. This may happen due to two different versions of design support library as CrashReporter also uses design support library internally.

debugCompile('com.balsikandar.android:crashreporter:1.1.0') {
    exclude group: 'com.android.support', module: 'design'
}

Crash Reporter On Duty

  • It'll capture all unhandled crashes and write them to a file in below directory
/Android/data/your-app-package-name/files/crashReports
  • To save crashes in a path of your choice, add below line in onCreate method of your Application class
CrashReporter.initialize(this, crashReporterPath);

Note: You don't need to call CrashReporter.initialize() if you want logs to be saved in default directory. If you want to use external storage then add storage permission in you manifest file.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Using log Exception API

If you want to capture exceptions then you can use below API

for ex :

try {
    // Do your stuff
} catch (Exception e) {
    CrashReporter.logException(e);
}

Pass exception thrown in below method

logException(Exception exception)

To get default crash reports path

CrashUtil.getDefaultPath()

you can access all crash/exception log files from this path and upload them to server for your need. Remember it's default path if you provide your own path you know where to find the logs...

TODO

Context awareness to track crashes and fix them. Identify crashes and categorise them in groups

Find this project useful ? ❀️

  • Support it by clicking the ⭐ button on the upper right of this page. ✌️

That's it for now

Contact - Let's connect and share knowledge

License

Copyright (C) 2016 Bal Sikandar
Copyright (C) 2011 Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Contributing to this Repo

Create a pull request and Dive In.

More Repositories

1

Kotlin-Flow-Android-Examples

Kotlin
899
star
2

Jetpack-Compose-WhatsApp-Clone

An example project to demonstrate how to build WhatsApp using Jetpack Compose.
Kotlin
615
star
3

Dagger-Hilt-Tutorial

An example project to demonstrate how to use the Dagger-Hilt in Android.
Kotlin
489
star
4

Jetpack-Compose-Android-Examples

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.
Kotlin
467
star
5

EditDrawableText

EditDrawableText - An EditText which makes your Drawable Clickable
Kotlin
302
star
6

Retrofit-Kotlin-Coroutines-Example

An example project to demonstrate how to use Retrofit with Kotlin Coroutines in Android
Kotlin
279
star
7

MVI-Architecture-Android-Beginners

This repository contains a beginner sample app that implements MVI architecture
Kotlin
228
star
8

Uber-Car-Animation-Android

An example project to demonstrate how to Add Uber Like Car Animation in Android App
Kotlin
215
star
9

RadialProgressBar

Radial ProgressBar inspired by Apple Watch OS. It is highly Customisable
Kotlin
164
star
10

Paging3-Android-Tutorial

An example project to demonstrate how to use the Paging-3 in Android.
Kotlin
144
star
11

Koin-Tutorial

Koin - step by step tutorial
Kotlin
115
star
12

Open-PDF-File-Android-Example

An example project to demonstrate how to open a PDF file in Android programmatically
Kotlin
69
star
13

screenshot

This library helps to take screenshot dynamically
Kotlin
67
star
14

ConcatAdapter-Android-Example

In this project, we have demonstrated how to use Concat Adapter in Android
Kotlin
61
star
15

gogeom

This is a Geometrical library for Go Language. Which includes multiple Geometrical calculations like Circle, Lines etc in different forms
Go
56
star
16

Dagger-Multi-Module-Android

Learn to use dagger for dependency management in a multi-module app
Kotlin
53
star
17

Fused-Location-API-Example

An example project to demonstrate how to use Fused Location API to fetch the current location in Android
Kotlin
47
star
18

ViewColorGenerator

A library to generate color palette for view, imageview and image from URL.
Kotlin
30
star
19

android-architecture-jetpack-components

Android Architecture Using Jetpack Components: Sample App
Kotlin
29
star
20

WAProfileImage

WAProfileImage - A library for Android for choosing and editing profile image like WhatsApp
Kotlin
29
star
21

Dagger-Dynamic-Feature-Module

Project for using dagger in dynamic feature module
Kotlin
23
star
22

Easy-Share-Android

Easy Share - A library for sharing in Android
Java
19
star
23

Go-Log

A Go logger package which provides utility on top of Go's normal Log package.
Go
19
star