+ 1
How can i create files in Java on android?
7 Answers
+ 2
PrintWriter writer = new PrintWriter("the-file-name.txt", "UTF-8"); writer.println("The first line"); writer.println("The second line"); writer.close();
+ 1
Vops, I forgot to specify, that it has to be on Android. My bad!
+ 1
I suppose the same way
+ 1
Tomas Krizko wait do u mean on your phone using solo learn or android based IDE?
+ 1
Tomas Krizko i see! you'd have to check out their help section to see if they allow creating files.
0
import java.io
File f = new File("filename.txt");
/*you can create a text file manually in the project folder or create a new one using: */
f.createNewFile();
There are a lot more specifics like if you want to specify file location you'll easily find these with a google search.
0
I use JAVA-N-IDE (Java IDE for Android)