How to Setup Cloudant Backend For ACRA (Application Crash Reports for Android)

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.75 out of 5)
Loading...

Tung Dao Xuan, tungdx1210@gmail.com, is the author of this article and he contributes to RobustTechHouse Blog

What is ACRA?

ACRA stands for Application Crash Reports for Android. This library helps your software send crash reports to a backend of your choice.

The Acralyzer is an open source backend for ACRA reports that is really simple to install. The only server-side requirement is Apache CouchDB. You can host it on your own server or use the free hosting services of Cloudant.

Setup Cloudant backend

Step 1:

Sign up an account with Cloudant

Step 2:

Open Replication tab and fill in the fields as shown below:

Source database (Remote Database tab): http://get.acralyzer.com/distrib-acra-storage

Target database (New Database tab) : acra-<name_of_your_database>

How to Setup Cloudant Backend For ACRA (Application Crash Reports for Android)

Then, click the Replicate button.

Step 3:

Continue to replicate another:

Source database (Remote Database tab): http://get.acralyzer.com/distrib-acralyzer

Target database (New Database tab) : acralyzer

How to Setup Cloudant Backend For ACRA (Application Crash Reports for Android)

Then, click the Replicate button.

After that, open the Databases tab, you will see the 2 databases you have replicated.

How to Setup Cloudant Backend For ACRA (Application Crash Reports for Android)

Step 4:

Open acra-<name_of_your_database> database (in this tutorial is: acra-demo), select the Permissions tab.

How to Setup Cloudant Backend For ACRA (Application Crash Reports for Android)

Click the Generate API key button and note down Key and Password. You will need them when you integrate ACRA with your Android software.

How to Setup Cloudant Backend For ACRA (Application Crash Reports for Android)

Remove the Reader permission and add the Writer permission for the key you have just generated.How to Setup Cloudant Backend For ACRA (Application Crash Reports for Android)

To confirm your backend is created successfully, go to https://<your_cloudant_account>.cloudant.com/acralyzer/_design/acralyzer/index.html and you will see the result as below figure.

How to Setup Cloudant Backend For ACRA (Application Crash Reports for Android)

Setup Android code with ACRA.

Step 1:

In build.gradle file, add ACRA library:

compile ‘ch.acra:acra:4.6.2’

Step 2:

In your AndroidManifest.xml file, declare internet permission.

<uses-permission android:name=”android.permission.INTERNET”>

Step 3:

In your class that extends from Application class, update ACRA configuration like this

@ReportsCrashes(
        formUri = "https://<your_cloudant_account>.cloudant.com/acra-<name_of_your_database>/_design/acra-storage/_update/report",
        reportType = HttpSender.Type.JSON,
        httpMethod = HttpSender.Method.POST,
        formUriBasicAuthLogin = "<your_key_that_is_created_before>",
        formUriBasicAuthPassword = "<your_password_that_is_created_before >",
        customReportContent = {
                ReportField.APP_VERSION_CODE,
                ReportField.APP_VERSION_NAME,
                ReportField.ANDROID_VERSION,
                ReportField.PACKAGE_NAME,
                ReportField.REPORT_ID,
                ReportField.BUILD,
                ReportField.STACK_TRACE,
                ReportField.DISPLAY,
                ReportField.TOTAL_MEM_SIZE,
                ReportField.AVAILABLE_MEM_SIZE
        },
        mode = ReportingInteractionMode.SILENT
)
public class <YourClassName> extends Application {

  @Override
  public final void onCreate() {
    super.onCreate();
    ACRA.init(this);
  }

Conclusion

You are done! Run your software and see your crash reports to find out where the problems in your software and fix it.

You can configure report content and use other features. To find out more, check out the links below:

https://github.com/ACRA/acra/wiki/AdvancedUsage

https://github.com/ACRA/acra/wiki/ReportContent

https://github.com/ACRA

http://www.acra.ch/

RobustTechHouse is a leading tech company for mobile app development and ECommerce web design and development. If you are interested to engage RobustTechHouse for your projects, you can contact us here. If you like our articles, you can follow us on our Facebook.

Recommended Posts
Showing 25 comments
  • wuziq
    Reply

    very clear. thank you.

  • Dai Software
    Reply

    this was a very well written article, the information was very nice Thanks for your efforts
    recipe meal kit app development

  • run 3
    Reply

    The information you are giving is excellent. I appreciate you taking the time to create and provide this valuable information.

  • totosite
    Reply

    When I read an article on this topic, totosite the first thought was profound and difficult, and I wondered if others could understand.. My site has a discussion board for articles and photos similar to this topic. Could you please visit me when you have time to discuss this topic?

  • casinosite
    Reply

    I’ve been troubled for several days with this topic. casinosite, But by chance looking at your post solved my problem! I will leave my blog, so when would you like to visit it?

  • 1v1 battle
    Reply

    This particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform!

  • bing maps
    Reply

    That’s good way. Thank you a lot.

  • mcdvoice
    Reply

    What a great and, of course, well written post. It`s so useful…

  • snake game
    Reply

    The information about the watch model you pointed to is very interesting

  • aamer
    Reply

    So lucky to come across your excellent blog. Your blog brings me a great deal of fun. Good luck with the site.
    woocommerce webshops

  • woocommerce webshops
    Reply

    Your blog brings me a great deal of fun. Good luck with the site.

  • Copywriting Vancouver
    Reply

    I am extremely delighted with this web journal. It’s a useful subject. It helps me all that much to take care of a few issues.

  • Women's hats
    Reply

    Your post has those facts which are not accessible from anywhere else.

  • Women's hats
    Reply

    Your post has those facts which are not accessible.

  • amal
    Reply

    Excellent article. The writing style which you have used in this article is very good and it made the article of better quality.
    breakfast board

  • lean consultant
    Reply

    So lucky to come across your excellent blog. Your blog brings me a great deal of fun. Good luck with the site.

  • ecommerce success pakistan
    Reply

    Thanks for the nice blog. It was very useful for me. I’m happy I found this blog.

  • Reply

    This blog is very informative. it adds alot in my knowledge.

  • khunjerab top weather
    Reply

    Your blog help me to understand a problem

  • winben humidifier
    Reply

    This is truly the web service provider I was looking for!

  • DJ near me
    Reply

    Thanks for the nice blog. It was very useful for me. I’m happy I found this blog.

  • asads
    Reply

    I am extremely delighted with this web journal. It’s a useful subject. It helps me all that much to take care of a few issues.
    Earn Through Freelancing

  • Small Business Ideas for Teens
    Reply

    So lucky to come across your excellent blog. Your blog brings me a great deal of fun. Good luck with the site.

  • how to learn quran
    Reply

    This is truly the web service provider I was looking for!

  • children Langley
    Reply

    Thanks for the nice blog. It was very useful for me. I’m happy I found this blog.

Leave a Comment

Contact Us

We look forward to your messages. Please drop us a note for any enquiries and we'll get back to you, asap.

Not readable? Change text. captcha txt
Review of the Top 3 Entertainment Mobile Apps in SingaporeTop 10 Mobile App Development Companies in Malaysia

SCAM ALERT

Do not send any money to the scammers

RobustTechHouse would like to alert members of the public that there are persons impersonating RobustTechHouse to offer jobs.
RobustTechHouse only recruits from legitimate job portals and does not require any payment to secure a job.

Members of the public contacted by the scammers may wish to:
(a) Make a police report, particularly if you have suffered any monetary loss.
(b) Report the scammers' contact numbers to ScamShield https://www.scamshield.org.sg/report