title: Write android logcat data to a file
body: <p>I want to dump Android logcat in a file whenever user wants to collect logs. Through adb tools we can redirect logs to a file using <code>adb logcat -f filename</code>, but how can I do this programmatically?</p>