I working on an Android app that reads from log cat. It works perfectly on all Android devices except for the Huawei company. I've read a lot of stuff about on the internet, and I saw that logcat is disabled in Huawei. So I activated it following these steps:
- Dial ##2846579##
- Go ProjectMenu->Background Setting->Log Setting
- Set Log switch to on
- Finally restart your device and enjoy the app
I did that now the logs appear in logcat when I execute the app connected to Eclipse. But Still I can't read from log cat it always returns null:
Runtime.getRuntime().exec(new String[] { "logcat", "-c" });
logcat = Runtime.getRuntime().exec(new String[] { "logcat" });
BufferedReader br = new BufferedReader(new InputStreamReader(logcat.getInputStream()), 4 * 1024);
String line;
while ((line = br.readLine()) != null) {System.out.println("HELLO");}
br.readLine()
always returns null.
Any help is appreciated.