3

I searched a lot about ACRA. Since after the code transferred from code.google.com to Github. All the answer's in SO has bad link's. All the example code's are not so useful as google docs has been deprecated for using it.

So please guide me how the new system woks and how to use it.

Aawaz Gyawali
  • 3,244
  • 5
  • 28
  • 48
  • 2
    What exactly are you trying to do with ACRA? The Github documentation is pretty comprehensive. https://github.com/ACRA/acra/wiki – Matter Cat Jul 29 '15 at 03:33
  • Store app crash stack trace somewhere on web to fix the crash bug. But don't know where and how? – Aawaz Gyawali Jul 29 '15 at 03:46
  • 1
    If you are looking for something to help you track crash reports can I recommend Crashlytics. Its pretty useful and easy to use. You need to sign up on their site and install a plugin for android studio. I cant imagine creating a project now with out it. – Eoin Jul 29 '15 at 04:39
  • Create a `CustomAcraSender` that implements `ReportSender` and send it to ACRA using `ACRA.getErrorReporter().setReportSender(sender);`. https://github.com/ACRA/acra/wiki/AdvancedUsage#implementing-your-own-sender – Matter Cat Jul 29 '15 at 05:00

1 Answers1

4

First, add ACRA to your project:

Maven

<dependency> 
    <groupId>ch.acra</groupId> 
    <artifactId>acra</artifactId> 
    <version>4.9.2</version> 
    <type>aar</type> 
</dependency>

Gradle

compile 'ch.acra:acra:4.9.2'

Now, you need a java class that extends Application. This is also defined in the manifest so no initialisation of the class is needed!

@ReportsCrashes(
    formUri = "http://example.com/reportpath"
)
public class MyApplication extends Application {
    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        ACRA.init(this);
    }
}

In your manifest:

<application android:icon="@drawable/icon" android:label="@string/app_name"
           IMPORTANT! ---> android:name="MyApplication"  >

You need these permissions: (read logs is not necessary if you do not need to read the logcat)

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

That is everything you need java-wise. From here it splits in two. If your site supports CouchDB:

Install Acralyzer: https://github.com/ACRA/acralyzer

If your server doesn't have CouchDB, try one of these: https://github.com/ACRA/acra/wiki/Backends

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • As of the backends, if you cannot use CouchDB I recomend the short one by Kevin Gaudin. Personally I am working on code to convert the text files made by it and take the content into a SQL database – Zoe Jul 08 '16 at 19:16
  • 1
    For my app, I use the free plan of Tracepot.com as ACRA backend. It has a caption of 1000 monthly reports, but I don't have all those reports. – Vektor88 Jul 08 '16 at 19:17
  • The backend is really up to you. My suggestions above was if you were using your own site and not something like that. You still need to change the link to the submittion site on Tracepot.com so you can recieve the reports – Zoe Jul 08 '16 at 19:19