ACRA Reporter

ACRA reporter is an appengine app for receiving acra error reports, decoding the stack traces, allowing easy fixes and tracking there of. It is not intended as a reporting tool on the number of errors the apps have..

Get Started

  1. Sign-up and logon, https://wintersacrareporter.appspot.com or http://acra.winters.org.nz (no ssl yet on the domain).
  2. Add your application details under “Applications->Add”.
    1. Important, the details are such.
    2. Package Name – must match your app’s package name, it is case sensitive.
    3. App Name – what your app is known by, used to display in the reporter.
    4. Error Report Script Authentication – this is the username/password your app will use to authenticate with the server when posting errors.
    5. E-Mail Template – a template for sending fix reports to the users (currently not implemented).
  3. Add code to your application to send the error reports.

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@ReportsCrashes(formKey = "",
formUri="https://wintersacrareporter.appspot.com/acrareport",
formUriBasicAuthLogin = "username",
formUriBasicAuthPassword = "password",
mode = ReportingInteractionMode.DIALOG,
resNotifTickerText = R.string.crash_notif_ticker_text,
resNotifTitle = R.string.crash_notif_title,
resNotifText = R.string.crash_notif_text,
resNotifIcon = android.R.drawable.stat_notify_error,
resDialogText = R.string.crash_dialog_text,
resDialogIcon = android.R.drawable.ic_dialog_info,
resDialogTitle = R.string.crash_dialog_title,
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt,
resDialogOkToast = R.string.crash_dialog_ok_toast)
public class CrashAppWrapper extends Application
{
@Override
public void onCreate()
{
// The following line triggers the initialization of ACRA
super.onCreate();
try
{
ACRA.init(this);
}catch(IllegalStateException e)
{
// ignore acra error
}
}


}


I use the dialog method, and prompt the user to enter their e-mail address in the comments, this allows me to e-mail them and tell them the problem has been fixed, or ask for more information.
Upload the proguard mapping files.
Currently uploading from within the reporter doesn’t work, but this is best done from a curl script within your continuous build system (you do use one???).
eg, in an ant script.

1
2
3
<exec executable="curl"> 
<arg line="-u username:password -T bin/proguard/mapping.txt &quot;https://wintersacrareporter.appspot.com/mappingfile?package=${app_package}&amp;version=${bigbuildnumber}&quot;"/>
</exec>

The username & password to use here is the one you entered when you signed up.
You also need to ensure the app_package and bigbuildnumber ant properties are set, eg.

1
<property name="app_package" value="nz.org.winters.android.gnfastcharge"/> <property name="bigbuildnumber" value="${buildmajor}.${buildnumber}.${svnrevision}"/>

Now, its all go – run some tests..

    Some other bits.

    Your existing error reports in the google docs spreadsheets can be altered to automatically upload any new records, and also upload any existing records..

    1. Open up the spreadsheet.
    2. Select Tools->Script Editor.
    3. Paste in the following.
       1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      /**
      * Retrieves all the rows in the active spreadsheet that contain data and logs the
      * values for each row.
      * For more information on using the Spreadsheet API, see
      * https://developers.google.com/apps-script/service_spreadsheet
      */
      function readRows() {
      var sheet = SpreadsheetApp.getActiveSheet();
      var rows = sheet.getDataRange();
      var numRows = rows.getNumRows();
      var values = rows.getValues();

      var headers = values[0];

      for (var i = 1; i <= numRows - 1; i++) {
      var payload = {};
      var row = values[i];
      for(var y = 1; y < headers.length; y++)
      {
      payload[headers[y]] = row[y];
      }


      var unamepass ="username:password";
      var digest = Utilities.base64Encode(unamepass);
      var digestfull = "Basic "+digest;
      var options =
      {
      "method" : "post",
      headers: {"Authorization": digestfull},
      "payload" : payload
      }

      //Logger.log(options);

      var feed = UrlFetchApp.fetch('https://wintersacrareporter.appspot.com/acrareport',options);
      Logger.log(feed.getContentText());
      }
      sheet.deleteRows(2, numRows-1)
      };

      /**
      * Adds a custom menu to the active spreadsheet, containing a single menu item
      * for invoking the readRows() function specified above.
      * The onOpen() function, when defined, is automatically invoked whenever the
      * spreadsheet is opened.
      * For more information on using the Spreadsheet API, see
      * https://developers.google.com/apps-script/service_spreadsheet
      */
      function onOpen() {
      var sheet = SpreadsheetApp.getActiveSpreadsheet();
      var entries = [{
      name : "Send Data",
      functionName : "readRows"
      }];
      sheet.addMenu("Script Center Menu", entries);
      };
    Remember to change username/password.

  1. Select Resources->Current Script Triggers
  2. Make the trigger run readRows from spreadsheet on form submit
  3. run the script “readrows” all your current rows will be uploaded and removed from the spreadsheet..
  4. Leave a Reply

    Your email address will not be published. Required fields are marked *