Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

create file android java specific folder

try {
        String rootPath = Environment.getExternalStorageDirectory()
                .getAbsolutePath() + "/MyFolder/";
        File root = new File(rootPath);
        if (!root.exists()) {
            root.mkdirs();
        }
        File f = new File(rootPath + "mttext.txt");
        if (f.exists()) {
            f.delete();
        }
        f.createNewFile();

        FileOutputStream out = new FileOutputStream(f);

        out.flush();
        out.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #file #android #java #specific #folder
ADD COMMENT
Topic
Name
6+6 =