Java tutorial
//package com.java2s; import android.util.Log; import java.io.IOException; public class Main { public static final String TAG = "P2PUtils"; public static void clearLog() { try { Runtime.getRuntime().exec(new String[] { "logcat", "-c" }); } catch (IOException e) { Log.e(TAG, e.toString()); } } }