title: how to execute pipe command in android?
body: <p>I want to display application logs.
  On terminal I used this command: adb logcat -s brief *:V|grep "pid" 
  it's display My Application logs.</p>
  
  <p>pid means application pid which is display in logcat table.</p>
  
  <pre><code>  public static String logProc()
  {
       String value = "";
       try
       {
           String cmd[] = {"logcat","-s","brief","*:V","|","grep",
                   android.os.Process.myPid()+""};
           Process p = Runtime.getRuntime().exec(cmd,null, null);
           BufferedReader reader = new BufferedReader(new 
                   InputStreamReader(p.getInputStream()));
           String line = reader.readLine();
  
           while (line != null)
           {
               value += line + "\n";
               line = reader.readLine();
           }
           p.waitFor();
       }
       catch (IOException e1)
       {
           e1.printStackTrace();
       } 
       catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      return value;
  }
  </code></pre>