Skip to content

Instantly share code, notes, and snippets.

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()) {
val fileWriter = FileWriter(file)
val bufferedWriter = BufferedWriter(fileWriter)
bufferedWriter.write("Hola")// <-- Aquí el contenido
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment