Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

new trace

  • Loading branch information...
commit 52c6b1a28b68d6c1d601b134259c69866ef5430a 1 parent a138aa9
Jon Vlachoyiannis authored
View
BIN  example/libs/sfalma-trace.jar
Binary file not shown
View
1  example/src/com/sfalma/trace/example/MainActivity.java
@@ -44,6 +44,7 @@ public void handlerInstalled() {}
findViewById(R.id.crash_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
+ int ar = 1/0;
throw new RuntimeException("exception requested by user");
}
});
View
BIN  sfalma-trace.jar
Binary file not shown
View
7 src/com/sfalma/trace/Sfalma.java
@@ -53,7 +53,6 @@
import android.util.Log;
-
public class Sfalma {
// FIXME: Use Gson
@@ -80,7 +79,9 @@ public static String createJSON(String app_package, String version, String phone
String exception_class = reader.readLine();
exception_json.put("where", exception_class.substring(exception_class.lastIndexOf("(") + 1, exception_class.lastIndexOf(")")));
+ exception_json.put("klass", getClass(stackTrace));
exception_json.put("backtrace", stackTrace);
+
json.put("exception", exception_json);
reader.close();
@@ -110,7 +111,7 @@ public static String MD5 (String data) throws Exception {
}
// FIXME: This need some optimizing
- public static String removeFirstLine(String in) {
+ public static String getClass(String in) {
String out = "";
int endOfFirstLine = in.indexOf("\n");
if (endOfFirstLine != -1 && endOfFirstLine+1 < in.length() ) {
@@ -142,7 +143,7 @@ public static void submitError(int sTimeout, Date occuredAt, final String stackt
List <NameValuePair> nvps = new ArrayList <NameValuePair>();
nvps.add(new BasicNameValuePair("data", createJSON(G.APP_PACKAGE, G.APP_VERSION, G.PHONE_MODEL, G.ANDROID_VERSION, stacktrace, SfalmaHandler.isWifiOn(), SfalmaHandler.isMobileNetworkOn(), SfalmaHandler.isGPSOn(), occuredAt)));
- nvps.add(new BasicNameValuePair("hash", MD5(removeFirstLine(stacktrace))));
+ nvps.add(new BasicNameValuePair("hash", MD5(stacktrace)));
httpPost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
// We don't care about the response, so we just hope it
Please sign in to comment.
Something went wrong with that request. Please try again.