1.
for(StackTraceElement i:Thread.currentThread().getStackTrace()){
System.out.println(i);
}
2.
Log.i("bill",Log.getSackTraceString(new Throwable());