How to show the "Send feedback to X" dialog?

1.2k Views Asked by At

Background

Some of Google's apps allow you to send feedback from within the app, instead of going to the play store.

For example this one (of this app) :

enter image description here

compare this to the original one: enter image description here

The question

Is it possible to open this dialog?

If so, how? And what really happens when the user posts the feedback? Is it being sent directly to the developer console? Can the developer return an answer to such a feedback? Can the dialog request that the user would leave an email? What are the features of this dialog?

If not, what do they use? It looks really similar to the dialog of sending information about crashes. Could it be that they use the same mechanism?

The reason why i'm thinking it's the same mechanism of sending errors is this post i've written, but it's supported only from API 14 , and i'm not sure about the consequences...

1

There are 1 best solutions below

5
On

Yes this is the crash report dialog. Yes the report goes to the developer console. No you cannot reply to the feedback. Yes, per the post you referenced it requires API 14 and can't be used otherwise. The dialog cannot be customized. The best way to see the features of the dialog is to open it using an app that provides it.

Based on your questions, it sounds that your requirements exceed what this dialog is capable of and you may need to invent a home-grown solution or use a third-party solution.

I've used this code fragment to enable sending feedback and explicitly opening the dialog with handled exceptions.

@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public ApplicationErrorReport createErrorReport (Exception e) {
    ApplicationErrorReport report = new ApplicationErrorReport ();
    report.packageName = report.processName = this.getPackageName ();
    report.time = System.currentTimeMillis ();
    report.type = null == e ? ApplicationErrorReport.TYPE_NONE : ApplicationErrorReport.TYPE_CRASH;
    report.systemApp = false;

    if (null != e) {
        ApplicationErrorReport.CrashInfo crash = new ApplicationErrorReport.CrashInfo ();
        crash.exceptionClassName = e.getClass ().getSimpleName ();
        crash.exceptionMessage = e.getMessage ();

        StringWriter writer = new StringWriter ();
        PrintWriter printer = new PrintWriter (writer);
        e.printStackTrace (printer);

        crash.stackTrace = writer.toString ();

        StackTraceElement stack = e.getStackTrace ()[0];
        crash.throwClassName = stack.getClassName ();
        crash.throwFileName = stack.getFileName ();
        crash.throwLineNumber = stack.getLineNumber ();
        crash.throwMethodName = stack.getMethodName ();

        report.crashInfo = crash;
    }
    return report;
}