Flurry Error Reporting for Android - android

Is there anyone using Flurry to generate reports for uncaught exceptions that could post some sample code on how to do this?
I don't see any example via Flurry themselves, and though I've seen code samples of custom exception reporters, I haven't seen a simple example of how to implement the basic error reporting just using Flurry.
Thanks.

This is all good feedback. We're looking into adding full stack traces for error reporting which we'll hopefully see in our next major SDK release. We'll also look at filtering by device model.
In the meantime we've added a new REST API for exporting your error reports if you want to do your own analysis. If you need help using it you can just contact our support or message me.
Sean / CTO / Flurry, Inc.

Flurry does it automatically (if you have it running). However, the error reporting is lame. They only catch the message w/o giving you the stack trace, so you may end up seeing (for example) that people are getting lots of NullPointerExceptions, but you won't have any idea where, or how, they're happening. If you try to do it yourself with the FlurryAgent.onEvent() method you'll quickly discover that they limit you to 255 characters.
If you need detailed error reporting it really is better to roll your own right now.

I wasn't going to post this initially, but since it sounds like Flurry's error reporting sucks, you should check android-remote-stacktrace. It sends the stack trace to a url, which you can use to redirect it to an e-mail or just gather it on the server.

I'm not using it for uncaught exceptions , but you can catch it and then send it to flurry.

I am using bugsense for error reports. It catches full stack trace when an uncaught exception happens and also gives some useful information about the device - OS version, you app's version, is WiFi available on the device, etc. You can add custom messages and tags for specific events.
I've already fixed a couple crashes in my app thanks to it.

Since people are posting alternatives for getting stack traces, I'll recommend ACRA. ACRA can send the stack trace to a spreadsheet on google drive/docs. Or you can also have it send to your server if you wish too. By default it also includes phone model, android version, memory of device, and other data too.

Related

it's possible add a variable to the Proguard Crash Report (Google Play ANR & Blocks)

anybody can explain if it's possible to attach a variable to the proguard crash reports??
I mean something like this:
java.lang.NullPointerException:
at es.com.myapp.dashboardActivity$askForUserBills.doInBackground (dashboardActivity.java) or .onPostExecute (dashboardActivity.java)
at es.com.myapp.dashboardActivity$askForUserBills.onPostExecute (dashboardActivity.java)
at android.os.AsyncTask.finish (AsyncTask.java:660))
**Application Variables: userID="967234112", myJsonObject=null << Something like this...**
In this example I requested "userID" and "myJsonObject"
It will be a great if it's possible, because you can check if your incoming data from a database in a specific user is corrupted, if X is malformed or null, etc...
Thanks all!
use Firebase Crashlyics instead. there you can report whenever you catch an Exception, instead of just logging to log-cat (currently only could find the Android documentation on fabric.io, which will soon be superseded by Firebase Crashlytics):
Crashlytics.log("Application Variables: userID="967234112", myJsonObject=null");
If you know you want to check something it is really easy. Instead of just relying on the code crashing, validate your input data to check if it is null. Then if it is you have a number of options:
use a service like Firebase Analytics to record the error
[not recommended] throw a more detailed exception with an error message
Crashes should only happen because of bugs in your code. You shouldn't be using them to record / trace input validation problems, as that really sucks for your users. Instead, write more robust code, and recover gracefully, while using a logging solution to find the bugs.

Remote Logging complete Logcat (Android) (React Native : Android)

How to get complete logcat from remote users phone?
I came across BUGFENDER and www.REMOTELOGCAT.com ... (didnt use yet.)
I need advice what professionals use for remote logging?
What is the industry standard?
How can I get complete logcat from my client's phone living in another country?
In iOS it gets saved in the phone itself so client can email that log file but whats the solution in android ?
P.S by 'complete logcat' i mean COMPLETE logcat rather than specified logs in code like log.e("some exception occured") as in crashlytics...
I'm not sure how to get the full logcat in Android.
What I can answer is that I'm professional and I use Bugfender for remote logging in iOS and React Native and I know many colleagues using Bufender for Android as well.

firebase android functional setup

Added firebase to my android marshmallow application and have run the application with the recommended FirebaseCrash.report(new Exception("")) to verify the setup and am getting the report in my firebase console.
Questions due to the developer guide being a bit unclear:
do I need to add a firebase.log or firebase.logcat to each of the caught exceptions in my application in order to get report entries for them. If so, which is recommended? Should I use firebasecrash.report instead?
Is there any additional work needed to capture uncaught exceptions generated
In the evaluation phase at this point and would prefer not to make a lot of code changes for something that might not work out.
From the documentation of Firebase Crash Reporting (I added numbers to correlate them to your questions):
Firebase Crash Reporting automatically generates reports for fatal errors (or uncaught exceptions) (2). However, you can also generate reports in instances where you catch an exception but still want to report the occurrence (1).
So:
if you want to report caught exception you have to report them yourself with FirebaseCrash.report().
uncaught exceptions are reported automatically.

How to learn a reason why a 3rd party, non-debuggable app crashed

In Android, is there a way to tell why app crashed on my device? Let's say I have root access to the device, but the app that crashed is not debuggable and does not print anything to logcat.
Just to reiterate, the app that crashed is not my app, I have no access to the source, and it's not debuggable (it's a release build). I just want to get any available insights on why it crashed.
EDIT: I forgot to mention, I only found the /data/anr/ and /data/tombstones as sources for potential information. Those do not contain the stacktraces. Is there anything more available?
EDIT: There is a lot of confusion in comments, please read the question carefully. What I'm after is some kind of low level component that knows about the reason of the crash. The virtual machine must know, right?
I identified following sources that may or may not have useful information about 3rd party apps crashes:
adb logcat -b crash
/data/tombstones/
/data/anr/
Cannot. In third-party app, you cannot get detail about crash report. In some rarely case, third-party application has saved crash reports to log file. If you know file location, you can analyze crash on that log file. Otherwise, there isn't any way.
In case you develop your own app, and your application already has released to user and you want to get some statistic about crash event. You can gain some insight by using Crash Report Service as I mention below.
In case you want go get crash report from your own application, here is some libraries and services for your: ACRA library. Crash report will generated and post to Google Form. Really easy to use and setup in your application. As document stated:
#ReportsCrashes(formUri = "http://www.yourselectedbackend.com/reportpath")
public class MyApplication extends Application {
#Override
public void onCreate() {
// The following line triggers the initialization of ACRA
super.onCreate();
ACRA.init(this);
}
}
But you must have your own server. (There are tutorials for deploying this server, but you still must have your own). If you want to depend all to third-party service then Crashlytics or Crittercism or Countly or Google search query

What is the best practice using Android Logger

I am new to Android. Please help me to know about the best practice of using Android Logger. Do I need to keep a file somewhere in android and keep on writing logs into it, or writing of logs into file is not necessary. What could be the best practice.
My real intention is this.
Once we go live, if our customers come back and tell us that something crashed or does not work in their android , then how do we debug ?
In the web application, I would ask my server administrator to provide the log files. What do we do with the android application when there is no server error, but something failed in the phone. Is there a way to get logs from the phone.
Thanks
Ravi
Depends on what you need, you need logging for semi debugging your application than you can easily use the buildin Log functionality. Via Logcat you can easiliy see the logs.
http://www.vogella.com/tutorials/AndroidLogging/article.html
//Declare a tag
String TAG= "SomeActivity";
//Log
Log.d(TAG, "Hello World"); //debug
Log.e(TAG, "Hello World"); //error
If you want to have logging of multiple devices when you have released your app. Use a dedicated Log Framework (e.g. Log4J) and upload it to a server.
One tip (if you are using Eclipse, and not directly related to question) - Eclipse is very unreliable for viewing logs. For apparently no reason it completely stops displaying logs every now and then. A simple solution is to use command line tools for viewing logs. On Linux you can do :
$adb logcat MyTag:D *:S
If you want to capture logs to a file you can do:
$adb logcat -d > logcat.txt.
Hope this helps!
If you are planning to publish/distribute your application then storing logs in a file is possible but as per my opinion better not a better solution. You can configure online tools from your app.
Catch all sever exceptions and sending all the details regarding that exception. And configure any one logging tool into you application.
You can see log4j http://logging.apache.org/log4j/2.x/ or ACRA http://acra.ch/ or http://www.crittercism.com/
The Android logger's (android.util.Log) output goes to a console that you don't have to maintain. You don't actually have to manage files, just outputs.
You have 5 categories of log:
verbose: use Log.v(tag, message)
debug: use Log.d(tag, message)
info: use Log.i(tag, message)
warning: use Log.w(tag, message)
error: use Log.e(tag, message)
For example:
Log.e("MyActivity", "Oops... caught this exception: " + exception.getMessage());
The LogCat console (this is its name) allows you filtering by log level. This is a ceil filtering. For example, if you filter by 'warnings', you will see all warnings and errors, but not verbose, debug and info messages.
You'll find more details here in the official documentation.
My real intention is this.
Once we go live, if our customers come back and tell us that something crashed or does not work in their android , then how do we debug ?
In the web application, I would ask my server administrator to provide the log files. What do we do with the android application when there is no server error, but something failed in the phone. Is there a way to get logs from the phone.
If you use file for storage logs - it possible problem with performance if the file become big. So you need clean file in time.
As for me best solution use firebase or https://fabric.io/.
We use fabric.io.
Also you can use some wrapper for default Log class. This one https://github.com/JakeWharton/hugo for example

Categories

Resources