diff --git a/ExaltedDice/.classpath b/ExaltedDice/.classpath
new file mode 100755
index 0000000..207072c
--- /dev/null
+++ b/ExaltedDice/.classpath
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/ExaltedDice/.project b/ExaltedDice/.project
new file mode 100755
index 0000000..9075306
--- /dev/null
+++ b/ExaltedDice/.project
@@ -0,0 +1,33 @@
+
+
+ ExaltedDice
+
+
+
+
+
+ com.android.ide.eclipse.adt.ResourceManagerBuilder
+
+
+
+
+ com.android.ide.eclipse.adt.PreCompilerBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.android.ide.eclipse.adt.ApkBuilder
+
+
+
+
+
+ com.android.ide.eclipse.adt.AndroidNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/ExaltedDice/AndroidManifest.xml b/ExaltedDice/AndroidManifest.xml
new file mode 100755
index 0000000..c472203
--- /dev/null
+++ b/ExaltedDice/AndroidManifest.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ExaltedDice/Change Log.txt b/ExaltedDice/Change Log.txt
new file mode 100644
index 0000000..34bf642
--- /dev/null
+++ b/ExaltedDice/Change Log.txt
@@ -0,0 +1,40 @@
+Exalted Dice Change Log
+
+0.0.1
+0.0.2
+0.0.3
+0.0.4
+0.0.5
+
+0.0.6 V6
+-remodeled onClickListeners
+-remodeled onLongClickListeners
+
+0.0.7 V7
+-Got Listview working with 10 item history
+-removed old onClickListener methods
+-removed old onLongClickListeners
+-ads working with internet permisions
+-Menu with exit option
+
+0.0.8 v8
+-cleaned code for efficency
+-Fixed error checking method to check for a string containing no ints.
+-Fixed shake listener problem
+-First release version, full, and ad free
+-due to a G Market problem, package name switched from com.TwentyCodes.android.ExaltedDice to com.TwentyCode.android.ExaltedDice
+
+
+0.0.9 V9
+-compiled under 1.5
+-updated ads
+-added System.gc();
+-added stringbuffer to checkForErrors() and results()
+-added a dynamic rollHistory list array
+-added clear history menu option
+
+0.0.10
+-added rotaion methods
+-reformated the output string
+-added crash report
+-added roll again feature
\ No newline at end of file
diff --git a/ExaltedDice/bin/ExaltedDice.apk b/ExaltedDice/bin/ExaltedDice.apk
new file mode 100644
index 0000000..8ca053b
Binary files /dev/null and b/ExaltedDice/bin/ExaltedDice.apk differ
diff --git a/ExaltedDice/bin/classes.dex b/ExaltedDice/bin/classes.dex
new file mode 100644
index 0000000..e2d7c85
Binary files /dev/null and b/ExaltedDice/bin/classes.dex differ
diff --git a/ExaltedDice/bin/resources.ap_ b/ExaltedDice/bin/resources.ap_
new file mode 100644
index 0000000..c9a1b20
Binary files /dev/null and b/ExaltedDice/bin/resources.ap_ differ
diff --git a/ExaltedDice/default.properties b/ExaltedDice/default.properties
new file mode 100755
index 0000000..a1ef8e9
--- /dev/null
+++ b/ExaltedDice/default.properties
@@ -0,0 +1,13 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Indicates whether an apk should be generated for each density.
+split.density=false
+# Project target.
+target=android-3
diff --git a/ExaltedDice/libs/admob-sdk-android.jar b/ExaltedDice/libs/admob-sdk-android.jar
new file mode 100644
index 0000000..e186671
Binary files /dev/null and b/ExaltedDice/libs/admob-sdk-android.jar differ
diff --git a/ExaltedDice/res/drawable/icon.png b/ExaltedDice/res/drawable/icon.png
new file mode 100644
index 0000000..b101000
Binary files /dev/null and b/ExaltedDice/res/drawable/icon.png differ
diff --git a/ExaltedDice/res/layout/list_row.xml b/ExaltedDice/res/layout/list_row.xml
new file mode 100755
index 0000000..b39b66e
--- /dev/null
+++ b/ExaltedDice/res/layout/list_row.xml
@@ -0,0 +1,6 @@
+
+
\ No newline at end of file
diff --git a/ExaltedDice/res/layout/main.xml b/ExaltedDice/res/layout/main.xml
new file mode 100755
index 0000000..cb2fc98
--- /dev/null
+++ b/ExaltedDice/res/layout/main.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ExaltedDice/res/values/array.xml b/ExaltedDice/res/values/array.xml
new file mode 100644
index 0000000..64e6bc4
--- /dev/null
+++ b/ExaltedDice/res/values/array.xml
@@ -0,0 +1,8 @@
+
+
+- Welcome to ExaltedDice!
+- Press the - button to lower your dice count by 1, or long press the - button to lower dice count by 10
- Press the + button to raise dice count by 1 of long press + to raise dice count by 10.
- When you press Roll, Your Results Will Be Displayed Here
+
+
+
+
diff --git a/ExaltedDice/res/values/attrs.xml b/ExaltedDice/res/values/attrs.xml
new file mode 100644
index 0000000..68a68fc
--- /dev/null
+++ b/ExaltedDice/res/values/attrs.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ExaltedDice/res/values/strings.xml b/ExaltedDice/res/values/strings.xml
new file mode 100755
index 0000000..eec08d3
--- /dev/null
+++ b/ExaltedDice/res/values/strings.xml
@@ -0,0 +1,12 @@
+
+
+
+ Exalted Dice
+
+Rolled:
+
+
+
+
+twentycodes@gmail.com
+
diff --git a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java
new file mode 100755
index 0000000..4c5b5ac
--- /dev/null
+++ b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/ExaltedDice.java
@@ -0,0 +1,361 @@
+package com.TwentyCode.android.ExaltedDice;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.os.Vibrator;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnLongClickListener;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+import android.widget.AdapterView.OnItemClickListener;
+
+public class ExaltedDice extends Activity implements OnClickListener, OnLongClickListener, OnItemClickListener {
+
+ private TextView dice;
+ private ListView listview;
+
+ private int intSuccesses;
+ public int intDice;
+
+ private ArrayList rollHistory = new ArrayList();
+ private ArrayList rolled = new ArrayList();
+
+ private final int ADD_DICE = R.id.up;
+ private final int SUB_DICE = R.id.down;
+ private final int ROLL_DICE = R.id.roll;
+
+ private static final int MENU_QUIT = Menu.FIRST;
+ private static final int MENU_CLEAR = Menu.FIRST + 1;
+
+ protected PostMortemReportExceptionHandler mDamageReport = new PostMortemReportExceptionHandler(this);
+
+ public void addDiceRolled() {
+ vibrate(50);
+ intDice = checkForErrors((dice.getText()).toString());
+ intDice = moreDice(intDice, 1);
+ dice.setText("" + intDice);
+ System.gc();
+ }
+
+ public void addDiceRolledonLongClick() {
+ vibrate(75);
+ intDice = checkForErrors((dice.getText()).toString());
+ intDice = moreDice(intDice, 10);
+ dice.setText("" + intDice);
+ System.gc();
+ }
+
+ public int checkForErrors(String string) {
+
+ int numDice = 0;
+ char charDice;
+ StringBuffer stringDice = new StringBuffer();
+ boolean errors = false;
+ boolean zeroCheck = true;
+ boolean isNumber = false;
+
+ if (string.length() == 0)
+ string += "" + 1;
+
+ for (int i = 0; i < string.length(); i++) {
+ // get the char
+ charDice = string.charAt(i);
+
+ try {
+
+ numDice = Integer.parseInt(Character.toString(charDice));
+
+ if (zeroCheck == true) {
+ if (numDice != 0) {
+ zeroCheck = false;
+ isNumber = true;
+ stringDice.append(numDice);
+ }
+ } else
+ stringDice.append(numDice);
+
+ } catch (NumberFormatException nFE) {
+ errors = true;
+ }
+
+ }
+
+
+ if (isNumber == false) {
+ toastLong("You inputed: \" "
+ + string
+ + " \", which contains no numbers, we will roll one dice for you.");
+ stringDice.append(1);
+
+ errors = false;
+ }
+
+ if (errors == true)
+ toastLong("You inputed: \" " + string
+ + " \", we are assuming you meant: "
+ + stringDice.toString());
+
+ if (stringDice.length() > 3) {
+
+ toastLong("Sorry, I can not roll " + stringDice
+ + " dice. Try Rolling Between 1 - 999 dice.");
+
+ numDice = 1;
+
+ } else
+ numDice = Integer.parseInt(stringDice.toString());
+
+ stringDice = null;
+ System.gc();
+ return numDice;
+ }
+
+ private void clearHistory() {
+ rollHistory.clear();
+ rolled.clear();
+ listview.setAdapter(new ArrayAdapter(this, R.layout.list_row, rollHistory));
+ }
+
+ public int lessDice(int number, int lowerBy) {
+
+ if (number <= lowerBy)
+ lowerBy = number - 1;
+
+ if (number > 1)
+ number = number - lowerBy;
+
+ System.gc();
+ return number;
+ }
+
+ public int moreDice(int number, int raiseBy) {
+ if (number > 989)
+ if (raiseBy > (number - 989))
+ raiseBy = 999 - number;
+ if (number < 999)
+ number = number + raiseBy;
+
+ System.gc();
+ return number;
+ }
+
+ @Override
+ public void onClick(View v) {
+
+ if (v.getId() == ADD_DICE)
+ addDiceRolled();
+
+ if (v.getId() == SUB_DICE)
+ subtractDiceRolled();
+
+ if (v.getId() == ROLL_DICE)
+ rollDice();
+
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ mDamageReport.run();
+ Thread.setDefaultUncaughtExceptionHandler(mDamageReport);
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ dice = (TextView) findViewById(R.id.dice);
+ listview = (ListView) findViewById(R.id.list);
+ Button btAddDice = (Button) findViewById(R.id.up);
+ Button btSubtractDice = (Button) findViewById(R.id.down);
+ Button btRollDice = (Button) findViewById(R.id.roll);
+ btAddDice.setOnClickListener(this);
+ btSubtractDice.setOnClickListener(this);
+ btRollDice.setOnClickListener(this);
+ listview.setOnItemClickListener(this);
+ btAddDice.setOnLongClickListener(this);
+ btSubtractDice.setOnLongClickListener(this);
+ listview.setAdapter(new ArrayAdapter(this, R.layout.list_row, getResources().getStringArray(R.array.hello_msg)));
+
+ System.gc();
+
+ }
+
+ public boolean onCreateOptionsMenu(Menu menu) {
+ menu.add(1, MENU_CLEAR, 0, "Clear Roll History");
+ menu.add(1, MENU_QUIT, 0, "Quit");
+ return true;
+ }
+
+
+ @Override
+ public void onItemClick(AdapterView> arg0, View arg1, int arg2, long arg3) {
+ if(rolled.size() != 0){
+ dice.setText("" + rolled.get(arg2));
+ rollDice();
+ }
+ }
+
+ public boolean onLongClick(View v) {
+ if (v.getId() == ADD_DICE) {
+ addDiceRolledonLongClick();
+
+ } else if (v.getId() == SUB_DICE) {
+ subtractDiceRolledonLongClick();
+
+ } else {
+ return false;
+ }
+ return true;
+ }
+
+ public boolean onOptionsItemSelected(MenuItem item) {
+
+ switch (item.getItemId()) {
+ case MENU_QUIT:
+ quitDialog();
+ return true;
+ case MENU_CLEAR:
+ clearHistory();
+ return true;
+ }
+ return false;
+
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ System.gc();
+ }
+
+ @Override
+ public void onRestoreInstanceState(Bundle savedInstanceState) {
+ super.onRestoreInstanceState(savedInstanceState);
+ rollHistory = savedInstanceState.getStringArrayList("roll_history");
+ dice.setText(savedInstanceState.getString("dice"));
+ rolled = savedInstanceState.getIntegerArrayList("rolled");
+ listview.setAdapter(new ArrayAdapter(this, R.layout.list_row, rollHistory));
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle savedInstanceState) {
+ savedInstanceState.putStringArrayList("roll_history", rollHistory);
+ savedInstanceState.putString("dice", dice.getText().toString());
+ savedInstanceState.putIntegerArrayList("rolled", rolled);
+ super.onSaveInstanceState(savedInstanceState);
+ }
+
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ System.gc();
+ }
+
+ public void quitDialog() {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage("Are you sure you want to quit?").setCancelable(
+ false).setPositiveButton("Yes",
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ ExaltedDice.this.finish();
+ }
+ }).setNegativeButton("No",
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ dialog.cancel();
+ }
+ });
+ builder.show();
+ }
+
+ public String results(int times) {
+ StringBuffer resultsString = new StringBuffer();
+ resultsString.append("Rolled "+ times +" dice\n");
+ int[] roll = rollGen(times);
+ resultsString.append("Successes: "+ successes(roll) +"\n");
+ resultsString.append("Rolled: ");
+ for (int i = 0; i < roll.length; i++) {
+ resultsString.append(roll[i] + ", ");
+ }
+ System.gc();
+ return resultsString.toString();
+ }
+
+ public void rollDice() {
+ vibrate(50);
+ intDice = checkForErrors((dice.getText()).toString());
+ dice.setText("" + intDice);
+ rolled.add(0, intDice);
+ rollHistory.add(0, results(intDice));
+ listview.setAdapter(new ArrayAdapter(this, R.layout.list_row, rollHistory));
+ System.gc();
+ }
+
+ public int[] rollGen(int times) {
+ int[] roll = new int[times];
+ Random random = new Random();
+ for (int i = 0; i < times; i++) {
+ roll[i] = random.nextInt(10) + 1;
+ }
+ System.gc();
+ return roll;
+ }
+
+ public void subtractDiceRolled() {
+ vibrate(50);
+ intDice = checkForErrors((dice.getText()).toString());
+ intDice = lessDice(intDice, 1);
+ dice.setText("" + intDice);
+ System.gc();
+ }
+
+ public void subtractDiceRolledonLongClick() {
+ vibrate(75);
+ intDice = checkForErrors((dice.getText()).toString());
+ intDice = lessDice(intDice, 10);
+ dice.setText("" + intDice);
+ System.gc();
+
+ }
+
+
+ public int successes(int[] roll) {
+ intSuccesses = 0;
+ for (int i = 0; i < roll.length; i++) {
+ if (roll[i] >= 7)
+ intSuccesses++;
+ if (roll[i] == 10)
+ intSuccesses++;
+ }
+ System.gc();
+ return intSuccesses;
+ }
+
+
+ public void toastLong(CharSequence msg) {
+ Toast toast = Toast.makeText(this, msg, Toast.LENGTH_LONG);
+ toast.show();
+ }
+
+
+ public void vibrate(long milliseconds) {
+ Vibrator vib = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
+ vib.vibrate(milliseconds);
+ }
+
+}
\ No newline at end of file
diff --git a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/PostMortemReportExceptionHandler.java b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/PostMortemReportExceptionHandler.java
new file mode 100644
index 0000000..1946fa2
--- /dev/null
+++ b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/PostMortemReportExceptionHandler.java
@@ -0,0 +1,190 @@
+package com.TwentyCode.android.ExaltedDice;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.lang.Thread.UncaughtExceptionHandler;
+import java.lang.reflect.Field;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.os.Build;
+
+public class PostMortemReportExceptionHandler implements UncaughtExceptionHandler, Runnable {
+ public static final String ExceptionReportFilename = "postmortem.trace";
+
+ private static final String MSG_SUBJECT_TAG = "Exception Report"; //"app title + this tag" = email subject
+ private static final String MSG_SENDTO = "twentycodes@gmail.com"; //email will be sent to this account
+ //the following may be something you wish to consider localizing
+ private static final String MSG_BODY = "Just click send to help make this application better. "+
+ "No personal information is being sent (you can check by reading the rest of the email).";
+
+ private Thread.UncaughtExceptionHandler mDefaultUEH;
+ private Activity mApp = null;
+
+ /*
+ * Constructor
+ */
+ public PostMortemReportExceptionHandler(Activity aApp) {
+ mDefaultUEH = Thread.getDefaultUncaughtExceptionHandler();
+ mApp = aApp;
+ }
+
+
+ @Override
+ public void uncaughtException(Thread t, Throwable e) {
+ submit(e);
+ //do not forget to pass this exception through up the chain
+ mDefaultUEH.uncaughtException(t,e);
+ }
+
+ public String getDebugReport(Throwable aException) {
+// NumberFormat theFormatter = new DecimalFormat("#0.");
+ //stack trace
+ StackTraceElement[] theStackTrace = aException.getStackTrace();
+
+ StringBuffer report = new StringBuffer();
+
+ report.append("--------- Application ---------\n\n");
+
+ report.append(mApp.getPackageName()+" generated the following exception:\n\n");
+
+ report.append(aException.toString() + "\n\n");
+
+ report.append("-------------------------------\n\n");
+
+ report.append("--------- Stack trace ---------\n\n");
+ for (int i = 0; i < theStackTrace.length; i++) {
+ report.append(" " + theStackTrace[i].toString() + "\n");
+ }
+ report.append("-------------------------------\n\n");
+
+ //app environment
+ PackageManager pm = mApp.getPackageManager();
+ PackageInfo pi;
+ try {
+ pi = pm.getPackageInfo(mApp.getPackageName(), 0);
+ } catch (NameNotFoundException eNnf) {
+ //doubt this will ever run since we want info about our own package
+ pi = new PackageInfo();
+ pi.versionName = "unknown";
+ pi.versionCode = 69;
+ }
+
+ Date theDate = new Date();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd_HH.mm.ss_zzz");
+ report.append("-------- Environment --------\n");
+ report.append("Time\t="+sdf.format(theDate)+"\n");
+ report.append("Device\t="+Build.FINGERPRINT+"\n");
+ try {
+ Field theMfrField = Build.class.getField("MANUFACTURER");
+ report.append("Make\t="+theMfrField.get(null)+"\n");
+ } catch (SecurityException e) {
+ } catch (NoSuchFieldException e) {
+ } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException e) {
+ }
+ report.append("Device: " + Build.DEVICE + "\n");
+ report.append("Brand: " + Build.BRAND + "\n");
+ report.append("Model: "+Build.MODEL+"\n");
+ report.append("Product: "+Build.PRODUCT+"\n");
+ report.append("App:\t "+mApp.getPackageName()+", version "+pi.versionName+" (build "+pi.versionCode+")\n");
+ report.append("Locale: "+mApp.getResources().getConfiguration().locale.getDisplayName()+"\n");
+ report.append("-----------------------------\n\n");
+
+ report.append("--------- Firmware ---------\n\n");
+ report.append("SDK: " + Build.VERSION.SDK + "\n");
+ report.append("Release: " + Build.VERSION.RELEASE + "\n");
+ report.append("Incremental: " + Build.VERSION.INCREMENTAL + "\n");
+ report.append("Build Id: " + Build.ID + "\n");
+ report.append("-------------------------------\n\n");
+
+ // If the exception was thrown in a background thread inside
+ // AsyncTask, then the actual exception can be found with getCause
+ report.append("--------- Cause ---------\n\n");
+ Throwable cause = aException.getCause();
+ if (cause != null) {
+ report.append(cause.toString() + "\n\n");
+ theStackTrace = cause.getStackTrace();
+ for (int i = 0; i < theStackTrace.length; i++) {
+ report.append(" " + theStackTrace[i].toString() + "\n");
+ }
+ }
+ report.append("-------------------------------\n\n");
+
+ report.append("END REPORT");
+
+ return report.toString();
+ }
+
+ protected void saveDebugReport(String aReport) {
+ //save report to file
+ try {
+ FileOutputStream theFile = mApp.openFileOutput(ExceptionReportFilename, Context.MODE_PRIVATE);
+ theFile.write(aReport.getBytes());
+ theFile.close();
+ } catch(IOException ioe) {
+ //error during error report needs to be ignored, do not wish to start infinite loop
+ }
+ }
+
+ public void sendDebugReportToAuthor() {
+ String theLine = "";
+ StringBuffer theTrace = new StringBuffer();
+ try {
+ BufferedReader theReader = new BufferedReader(new InputStreamReader(mApp.openFileInput(ExceptionReportFilename)));
+ while ((theLine = theReader.readLine())!=null) {
+ theTrace.append(theLine+"\n");
+ }
+ if (sendDebugReportToAuthor(theTrace.toString())) {
+ mApp.deleteFile(ExceptionReportFilename);
+ }
+ } catch (FileNotFoundException eFnf) {
+ // nothing to do
+ } catch(IOException eIo) {
+ // not going to report
+ }
+ System.gc();
+ }
+
+ public Boolean sendDebugReportToAuthor(String aReport) {
+ if (aReport!=null) {
+ Intent theIntent = new Intent(Intent.ACTION_SEND);
+ String theSubject = mApp.getTitle()+" "+MSG_SUBJECT_TAG;
+ String theBody = "\n"+MSG_BODY+"\n\n"+aReport+"\n\n";
+ theIntent.putExtra(Intent.EXTRA_EMAIL,new String[] {MSG_SENDTO});
+ theIntent.putExtra(Intent.EXTRA_TEXT, theBody);
+ theIntent.putExtra(Intent.EXTRA_SUBJECT, theSubject);
+ theIntent.setType("message/rfc822");
+ Boolean hasSendRecipients = (mApp.getPackageManager().queryIntentActivities(theIntent,0).size()>0);
+ if (hasSendRecipients) {
+ mApp.startActivity(theIntent);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return true;
+ }
+ }
+
+ @Override
+ public void run() {
+ sendDebugReportToAuthor();
+ }
+
+ public void submit(Throwable e) {
+ String theErrReport = getDebugReport(e);
+ saveDebugReport(theErrReport);
+ //try to send file contents via email (need to do so via the UI thread)
+ mApp.runOnUiThread(this);
+ }
+}