Java tutorial
//package com.java2s; import java.io.File; import java.io.IOException; import android.util.Log; public class Main { /** * Create file if !exist * * @param filePath * The absolute file path we need to create * * @throws IOException * Input/Output exceptions */ public static void createFile(File filePath) { if (!filePath.exists()) { try { filePath.createNewFile(); Log.d("RDWR", "createFile: " + filePath); } catch (IOException e) { e.printStackTrace(); Log.d("RDWR", "CreateFile: " + e.getMessage()); } } } }