Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 15, 2020 21:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save parzibyte/08df8a94ab0a86c3ce4fbb960997a39c to your computer and use it in GitHub Desktop.
// 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