Git Product home page Git Product logo

sherlock's Introduction

Sherlock

Maintenance Build Status HitCount Open Source Love Maven Central API Twitter Follow

Sherlock reports any crash that occurres in your application as a notification. You just need to initialize Sherlock at the start of your application and it will take care of the rest.

Motivation

The motivation behind creating Sherlock is to make the life of Developer and tester easier. Whenever a tester is testing the app and he/she encounters a crash, most of the time they don't have enough details in their hand to enable developer to start fixing the crash immediately. Now with the help of Sherlock, any tester will have enough info to report the crash.

Alt text

Demo

Installation

debugCompile('com.github.ajitsing:sherlock:1.0.4@aar') {
    transitive = true
}
releaseCompile('com.github.ajitsing:sherlock-no-op:1.0.4@aar')

Usage

To start using Sherlock just add the below line in the onCreate() method of Application class.

public class MyApplication extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    Sherlock.init(this); //Initializing Sherlock
  }
}

Once you add Sherlock.init(this) Sherlock will take care of reporting all the crashes to you.

See All Crashes

You can view all the crashes by starting the CrashListActivity.

Get All Crashes Captured By Sherlock

Sherlock also provides you a way to get all the crashes which are reported by Sherlock in form of java object. You can get them using below line of code.

Sherlock.getInstance().getAllCrashes()

Before accessing getInstance() make sure that you have initialized Sherlock, otherwise it will throw SherlockNotInitializedException.

App Info

By default Sherlock only captures the version of your application and shows that as part of crash details. If you want to provide some extra details regarding app, you can do so by providing an AppInfoProvider to the Sherlock.

Sherlock.setAppInfoProvider(new AppInfoProvider() {
  @Override
  public AppInfo getAppInfo() {
    return new AppInfo.Builder()
               .with("Version", "2.21") //You can get the actual version using "AppInfoUtil.getAppVersion(context)"
               .with("BuildNumber", "221B")
               .build();
  }
});

Contributing

You can contribute to Sherlock by forking the repo and creating pull requests. You can also contribute by reporting bugs/issues. If you want to see a new feature in Sherlock, just add that as an issue with enough details.

LICENSE

Copyright (C) 2017 Ajit Singh

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.

sherlock's People

Contributors

ajitsing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sherlock's Issues

Theming

Is their a way to theme the list activity?

Sent from my Mi 5 using FastHub

Too many dependencies

Hello,

this is an interesting library, thanks for sharing! Unfortunately including Realm will be prohibitive for quite a few devs cause of its size. Also, enabling databinding just for the sake of including this library in a commercial project would be very difficult to justify.

Libraries should minimize dependencies like that to make it easier for developers to integrate them into projects. I would suggest rewriting it without these 2 components.

Cheers,
Sakis

Is posible to show Dialog Crash Error

When detect error crash, is posible show a dialog with buttons (close,detaile, report) without notification?
Detaile -> open crash report
report -> open email for send a developer

CrashListActivity not opening on Android O

So I updated the SDK to 26 in my launcher app and a crash accurs telling me the activity does not exist and if I implemented it in my Manifest. So I thought about it and made a new activity that extends CrashListActivity and it opens but nothing shows. Notifications do not appear either to indicate crash. whats happening...

CrashListActivity does not exist when use sherlock-no-op on release

com.singhajit.sherlock.crashes.activity does not exist
import com.singhajit.sherlock.crashes.activity.CrashListActivity;
^
1 error

does not exists when use releaseCompile('com.github.ajitsing:sherlock-no-op:1.0.2@aar')

maybe you can provide method Sherlock.openCrashListActivity(context); ?

Add no-op dependency for release build type

Hello,

It's a usual practice for libraries like this (that only exist for debug builds) to release a no-op version of the library that is completely empty, so that users of the library can use it in their app without worrying that the library is going to increase their release APK size, or cause any side effects in production. For an example see here: https://github.com/square/leakcanary

This can be fixed on the developers side by using an interface (for example see https://github.com/athkalia/Just-Another-Android-App/blob/8a5c677b2b0d0f2dcc123d40b770307a13786b64/app/src/main/java/com/example/tools/stetho/StethoTool.java in my project for introducing stetho only for debug builds), but it's much more convenient when fixed by the library

Crashing

Hi Ajit,

I tried implementing this lib in build.gradle in my app(as a dependency).

  1. debugCompile('com.github.ajitsing:sherlock:1.0.4@aar') {
    transitive = true
    }
    releaseCompile('com.github.ajitsing:sherlock-no-op:1.0.4@aar')

  2. Sherlock.init(this); in my application.

And also triggered Exception manually. As expected it created Notification. But on click of notification the Sherlock CrashActivity is not launching and it is crashing due Null pointer Exception. Can you please help on this at earliest?

Regards,
Vijay

Sherlock.getInstance().getAllCrashes() issue

crash.getId() return 1, then always 2
so every next crash after 2nd will open not proper report!

and reports from notification opens not proper crash details, too.

issue

NOTE: issue can be reproduced only if crash happened in Application onCreate() or near it, i mean on app start

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.