Git Product home page Git Product logo

reportoandroid's Introduction

An android report library that allows to collect the app data like logcat, preferences, databases and then share it. With this library, when the QA or even the developer detect and issue/bug, he can provide more information about it that helps to fix it, so we can avoid the "unable to reproduce" state

By default it creates a zip file that can be shared via email for example.

Please be sure to use this library only on the development mode if you dont want violate your users' privacy.

How to use

Add maven central to your project build gradle

allprojects {
    repositories {
        //...
        mavenCentral()
    }
}

Add this to your module build.gradle

implementation 'io.github.ohoussein:reportoandroid:1.0.4'

and in your manifest file, under the application tag, add

<provider android:name="androidx.core.content.FileProvider"
    android:authorities="dev.ohoussein.reportoandroid.provider"
    android:exported="false"
    android:grantUriPermissions="true">

    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/reporto_file_provider" />

</provider>

This is necessary when you use the default result handler (the ZipResultHandler) in order to share the zip file.

To use all the prebuilt module, you have to create the Reporto in your Application class like this

        Reporto.Builder()
            .addLogcatModule()
            .addLogcatModule(LogcatModule.LogParams(bufferName = LogcatModule.BUFFER_EVENTSLOG))
            .addPreferencesModule()
            .addDatabaseModule()
            .showNotification()
            .create(this)
  • showNotification() : add a notification that create a report when click on
  • addDatabaseModule() : for add the databases in the report
  • addPreferencesModule() : for add the preferences in their xml format
  • addLogcatModule() : add the last device's log
  • addLogcatModule(LogcatModule.LogParams(bufferName = LogcatModule.BUFFER_EVENTSLOG)) : maybe you want the events logs like the activities transition
  • addModule(myModule) : to add custom report data

The Reports can be customized, for example you can add a screenshot or a http interceptor to your reports data

You can Generate a report manually by calling the report method: Reporto.instance.report(myActivity)

Customisation

When we set showNotification to true, it creates a notification that launches the ReportActivity. You can start this activity by yourself with startActivity(Intent(context, ReportActivity::class.java))

By default, Reporto use the ZipFileHandler to collects all the data (logs, databases, ...) put them in a zip file and shares it, so you can send it via e-mail, store it in the device...

This behavior can be customized by implementing the ResultHandler and set it in the Reporto Builder like this

        Reporto
            .Builder()
             //...
            .resultHandler(MyCustomHandler())
            .create(this)

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.