How do I find the caller of a method using stacktrace or reflection?

StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace() According to the Javadocs: The last element of the array represents the bottom of the stack, which is the least recent method invocation in the sequence. A StackTraceElement has getClassName(), getFileName(), getLineNumber() and getMethodName(). You will have to experiment to determine which index you want (probably stackTraceElements[1] or [2]).

How do I obtain crash-data from my Android application?

You might try the ACRA (Application Crash Report for Android) library: ACRA is a library enabling Android Application to automatically post their crash reports to a GoogleDoc form. It is targetted to android applications developers to help them get data from their applications when they crash or behave erroneously. It’s easy to install in your … Read more

How can I convert a stack trace to a string?

Use Throwable.printStackTrace(PrintWriter pw) to send the stack trace to an appropriate writer. import java.io.StringWriter; import java.io.PrintWriter; // … StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); String sStackTrace = sw.toString(); // stack trace as a string System.out.println(sStackTrace);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)