Search
 
SCRIPT & CODE EXAMPLE
 

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();
    }
Comment

PREVIOUS NEXT
Code Example
Java :: how to get date android studio 
Java :: discord jda remove @everyone from channel 
Java :: how to byheart faster 
Java :: checkindex java 
Java :: Date from String java3 
Java :: create map java 
Java :: java randint 
Java :: java stop executing my program 
Java :: java compare two lists ignore case 
Java :: check if table exist sqlite java 
Java :: how to set landscape in android studio 
Java :: javafx change text size 
Java :: primefaces datepicker custom validation 
Java :: how to extract decimal vqalue from float in android studio 
Java :: string starts with alphabet java 
Java :: java for range loop 
Java :: arrays.aslist.add 
Java :: java create list of strings 
Java :: java check if divisible 
Java :: unable to find bundled java version. flutter 
Java :: convert string to byte java 
Java :: how to instantiate hashmap in java 
Java :: how to check if a char is a letter java 
Java :: isnumber java 
Java :: java foreach list 
Java :: what is an error in java 
Java :: eval in java 
Java :: change height of row at JTable 
Java :: try catch out of bounds exception java 
Java :: how to generate random number in java 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =