This commit is contained in:
serso 2012-10-03 14:04:50 +04:00
parent 18ad81cc08
commit a145edbd27
5 changed files with 156 additions and 135 deletions

View File

@ -57,5 +57,11 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<activity android:name="org.acra.CrashReportDialog"
android:theme="@android:style/Theme.Dialog"
android:launchMode="singleInstance"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true" />
</application> </application>
</manifest> </manifest>

View File

@ -85,6 +85,11 @@
</dependency> </dependency>
<!--OTHER--> <!--OTHER-->
<dependency>
<groupId>ch.acra</groupId>
<artifactId>acra</artifactId>
<version>4.3.0</version>
</dependency>
<dependency> <dependency>
<groupId>com.google.android</groupId> <groupId>com.google.android</groupId>

View File

@ -211,5 +211,12 @@
<string name="result">Result</string> <string name="result">Result</string>
<string name="other">Other</string> <string name="other">Other</string>
<string name="derivatives">Derivatives/Integrals</string> <string name="derivatives">Derivatives/Integrals</string>
<string name="crashed">Calculator++ has been crashed…</string>
<string name="crash_dialog_title">Calculator++ crash report confirmation</string>
<string name="crash_dialog_text">
Unfortunately, Calculator++ has been crashed.\n\n
In order to fix the problem we need some information about it. It\'s highly recommended to send crash report via email (after pressing \'Ok\' button you will see all sent data in the new window).\n\n
Do you want to send crash report via email?
</string>
</resources> </resources>

View File

@ -58,9 +58,6 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
*/ */
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
CalculatorApplication.registerOnRemoteStackTrace();
/*final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);*/ /*final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);*/
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);

View File

@ -12,6 +12,9 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import net.robotmedia.billing.BillingController; import net.robotmedia.billing.BillingController;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.solovyev.android.ads.AdsController; import org.solovyev.android.ads.AdsController;
import org.solovyev.android.calculator.history.AndroidCalculatorHistory; import org.solovyev.android.calculator.history.AndroidCalculatorHistory;
@ -22,6 +25,12 @@ import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
* Date: 12/1/11 * Date: 12/1/11
* Time: 1:21 PM * Time: 1:21 PM
*/ */
@ReportsCrashes(formKey = "",
mailTo = "se.solovyev+programming+calculatorpp+crashes@gmail.com",
mode = ReportingInteractionMode.DIALOG,
resToastText = R.string.crashed,
resDialogTitle = R.string.crash_dialog_title,
resDialogText = R.string.crash_dialog_text)
public class CalculatorApplication extends android.app.Application { public class CalculatorApplication extends android.app.Application {
private static final String paypalDonateUrl = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=se%2esolovyev%40gmail%2ecom&lc=RU&item_name=Android%20Calculator&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"; private static final String paypalDonateUrl = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=se%2esolovyev%40gmail%2ecom&lc=RU&item_name=Android%20Calculator&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted";
@ -30,7 +39,6 @@ public class CalculatorApplication extends android.app.Application {
public static final String AD_FREE_P_KEY = "org.solovyev.android.calculator_ad_free"; public static final String AD_FREE_P_KEY = "org.solovyev.android.calculator_ad_free";
public static final String ADMOB_USER_ID = "a14f02cf9c80cbc"; public static final String ADMOB_USER_ID = "a14f02cf9c80cbc";
public static final String REMOTE_STACK_TRACE_URL = "http://calculatorpp.com/crash_reports/upload.php";
@NotNull @NotNull
private static CalculatorApplication instance; private static CalculatorApplication instance;
@ -46,6 +54,8 @@ public class CalculatorApplication extends android.app.Application {
@Override @Override
public void onCreate() { public void onCreate() {
ACRA.init(this);
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
setTheme(preferences); setTheme(preferences);
@ -106,10 +116,6 @@ public class CalculatorApplication extends android.app.Application {
builder.create().show(); builder.create().show();
} }
public static void registerOnRemoteStackTrace() {
//Thread.setDefaultUncaughtExceptionHandler(new CustomExceptionHandler(null, REMOTE_STACK_TRACE_URL));
}
@NotNull @NotNull
public CalculatorActivityHelper createActivityHelper(int layoutResId, @NotNull String logTag) { public CalculatorActivityHelper createActivityHelper(int layoutResId, @NotNull String logTag) {
return new CalculatorActivityHelperImpl(layoutResId, logTag); return new CalculatorActivityHelperImpl(layoutResId, logTag);