Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

write in text file android studio

// this function allow you to write in text file
private void writeToFile(String data,Context context) {
        try {
            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(context.openFileOutput("config.txt", Context.MODE_PRIVATE));
            outputStreamWriter.write(data);
            outputStreamWriter.close();
        }
        catch (IOException e) {
            Log.e("Exception", "File write failed: " + e.toString());
        }
    }
Comment

PREVIOUS NEXT
Code Example
Java :: print string in java 
Java :: how to update java runtime 
Java :: regex pattern for valid logins 
Java :: android dialog box example 
Java :: get string from int java 
Java :: Iterator to list (Java) 
Java :: java program to remove duplicate words in a string 
Java :: pre increment and post increments 
Java :: @override java example 
Java :: linear search algorithm java 
Java :: android get last crash adb 
Java :: first and last digit of a number in java 
Java :: java add element to existing array 
Java :: java date and time 
Java :: equals ignore case java 
Java :: class declaration in java 
Java :: set toolbar background color android 
Java :: sort a list with custom comparator java 
Java :: button getsource 
Java :: how to create folder java 
Java :: reverse java 
Java :: vscode code formatter cannot format 
Java :: java throws keyword 
Java :: java sort a map by keys 
Java :: mockito method called 
Java :: hashmap 
Java :: loop array using stream java 
Java :: vue composition watch 
Java :: java check if string ends with 
Java :: method parameters in java 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =