Skip to content

Commit

Permalink
Added ARCA for error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
andresth committed Feb 11, 2017
1 parent 83c8fb3 commit 156f275
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ dependencies {
compile 'us.feras.mdv:markdownview:1.1.0'
compile group: 'com.atlassian.commonmark', name:'commonmark', version:'0.8.0'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'ch.acra:acra:4.9.2'
}
7 changes: 5 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
<!-- <uses-permission android:name="android.permission.READ_PROFILE" /> -->
<!-- <uses-permission android:name="android.permission.READ_CONTACTS" /> -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_LOGS" />

<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> -->
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name="KandroidApplication"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
Expand Down Expand Up @@ -41,15 +43,16 @@
</activity>
<activity
android:name=".ui.AboutActivity"
android:label="@string/title_activity_about"></activity>
android:label="@string/title_activity_about" />
<activity
android:name=".ui.SettingsActivity"
android:label="@string/title_activity_settings">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="in.andres.kandroid.ui.MainActivity" />
</activity>
<activity android:name=".ui.TaskDetailActivity"></activity>
<activity android:name=".ui.TaskDetailActivity" />
<!--<activity android:name=".ui.TaskEditActivity"></activity>-->
</application>

</manifest>
29 changes: 29 additions & 0 deletions app/src/main/java/in/andres/kandroid/KandroidApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package in.andres.kandroid;


import android.app.Application;
import android.util.Log;

import org.acra.*;
import org.acra.annotation.*;

/**
* Created by thomas on 11.02.17.
*/

@ReportsCrashes(mailTo = "[email protected]",
customReportContent = { ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT },
mode = ReportingInteractionMode.DIALOG,
resDialogIcon = android.R.drawable.stat_notify_error,
resDialogTitle = R.string.acra_dialog_title,
resDialogText = R.string.acra_dialog_text,
resDialogPositiveButtonText = R.string.acra_send_mail,
resDialogCommentPrompt = R.string.acra_dialog_comment_prompt)
public class KandroidApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Log.i(Constants.TAG, "Start ACRA");
ACRA.init(this);
}
}
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,11 @@
<string name="action_delete">Delete</string>
<string name="menu_caption_comment">Comment #%d</string>
<string name="menu_caption_subtask">Comment #%d</string>

<!--ARAC strings-->
<string name="acra_send_mail" translatable="false">Send email</string>
<string name="acra_dialog_title" translatable="false">Kandroid has crashed</string>
<string name="acra_dialog_comment_prompt" translatable="false">You might add your comments about the problem below:</string>
<string name="acra_dialog_text" translatable="false">An unexpected error occurred forcing the
application to stop. Please help us fix this by sending us the error data via email.</string>
</resources>

0 comments on commit 156f275

Please sign in to comment.