Java tutorial
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be import java.io.IOException; public class Main { private static final String TOUCHONEFILE = "touch /mnt/sdcard/onPageLoadStoppedFlag"; private static final String DELETEONEFILE = "rm -r /mnt/sdcard/onPageLoadStoppedFlag"; public static void createStorageFile(boolean flag) { try { if (flag) { Runtime.getRuntime().exec(TOUCHONEFILE); } else { Runtime.getRuntime().exec(DELETEONEFILE); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }