Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Definir ruta del archivo
val nombreArchivo = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString() + "/" + "test.csv"
Toast.makeText(this, "Guardando en $nombreArchivo", Toast.LENGTH_SHORT).show()
val file = File(nombreArchivo)
if (!file.exists()) {
file.createNewFile()
}
val fileWriter = FileWriter(file)
val bufferedWriter = BufferedWriter(fileWriter)
bufferedWriter.write("Hola")// <-- Aquí el contenido
bufferedWriter.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment